@import "../../assets/lib/iti/css/demo.css";
@import "../../assets/lib/iti/css/intlTelInput.css";

.phone-input-error.phone-validation-feedback {
    position: static;
    display: block;
    width: auto;
    max-width: 100%;
    margin: 6px 0 0;
    font-size: 11px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.phone-input-error.phone-validation-feedback:empty {
    display: none;
}

.phone-validation-feedback .phone-validation-message {
    font-size: 11px;
    color: #c62828;
}

.phone-validation-feedback[data-state="valid"] .phone-validation-message {
    color: #16723a;
}

.phone-validation-feedback[data-state="pending"] .phone-validation-message {
    color: #555;
}

/* Shared desktop profile/checkout contact presentation. */
.profile-phone-control {
    position: relative;
    width: 100%;
    min-width: 0;
    grid-column: 1 / -1;
}
.profile-phone-control .iti {
    width: 100%;
}
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) .profile-phone-control input {
    box-sizing: border-box;
    width: 100%;
    padding-right: 38px;
}
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) :is(.phone-field, .emailWrap, .email-field) .profile-phone-control > .confirmed {
    position: absolute;
    top: 50%;
    bottom: auto;
    right: 8px;
    transform: translateY(-50%);
}
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) :is(.profile-phone-control, .email-field) > .confirmed,
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) :is(.profile-phone-control, .email-field) > .confirmed.notConfirmed {
    width: 18px;
    height: 18px;
    margin: 0;
    border-radius: 50%;
    text-indent: 0;
    color: #fff;
    background: #d99a16;
}
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) :is(.profile-phone-control, .email-field) > .confirmed.notConfirmed {
    background: url("../images/restaurants_theme/contact-unconfirmed.svg") center / contain no-repeat;
}
body.page-profile :is(.profile-phone-control, .email-field) > .confirmed.notConfirmed {
    background-image: url("../images/store_theme/contact-unconfirmed.svg");
}
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) :is(.profile-phone-control, .email-field) > .confirmed.notConfirmed::before {
    content: none;
}
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) :is(.profile-phone-control, .email-field) > .confirmed.isConfirmed {
    background: #24ad70;
}
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) :is(.profile-phone-control, .email-field) > .confirmed::before {
    content: "!";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font: bold 14px/1 Arial, sans-serif;
}
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) :is(.profile-phone-control, .email-field) > .confirmed.isConfirmed::before {
    content: "\2713";
    font-size: 12px;
}
.profile-phone-control .confirmed:focus-visible {
    outline: 2px solid #946700;
    outline-offset: 3px;
}
.profile-phone-feedback {
    display: flex;
    flex-direction: column;
    grid-column: 1 / -1;
    gap: 3px;
    margin-top: 3px;
    min-width: 0;
}
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) .profile-phone-feedback > :is(.phone-input-error, .verify-btn) {
    position: static;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-family: Arial, sans-serif;
    font-size: 10px;
    font-style: normal;
    font-weight: 400;
    line-height: 14px;
    text-align: left;
}
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) .profile-phone-feedback > .phone-input-error:empty {
    display: none;
}
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) .profile-phone-feedback .phone-validation-message {
    font: inherit;
}
.profile-phone-feedback > :is(.phone-input-error, .verify-btn)::before {
    content: "!";
    display: inline-flex;
    flex: 0 0 10px;
    align-items: center;
    justify-content: center;
    width: 10px;
    height: 10px;
    margin-top: 2px;
    border-radius: 50%;
    background: #ad6666;
    color: #fff;
    font: 8px/1 Arial, sans-serif;
}
.profile-phone-feedback .phone-input-error[data-state="valid"]::before {
    content: "\2713";
    background: #24ad70;
}
.profile-phone-feedback .phone-input-error[data-state="pending"]::before {
    content: "\2026";
    background: #858585;
}
.profile-phone-feedback .phone-validation-feedback[data-state="valid"] .phone-validation-message {
    color: #079447;
}
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) .profile-phone-feedback > .verify-btn {
    color: #087bea;
    cursor: pointer;
}
.profile-phone-feedback .verify-btn::before {
    content: "";
    background: #368fe3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M6.6 10.8a15 15 0 006.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1C10.6 21 3 13.4 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.5.6 3.6.1.4 0 .8-.3 1.1z'/%3E%3C/svg%3E") center / 7px 7px no-repeat;
}
body:is(.customers-my_profile-page, .restaurants-checkout-page, .page-profile) .profile-phone-feedback > .verify-btn:hover {
    color: #0561bf;
    text-decoration: underline;
}
.profile-phone-feedback .verify-btn:focus-visible {
    outline: 2px solid #087bea;
    outline-offset: 2px;
}
.profile-phone-tooltip {
    position: absolute;
    z-index: 20;
    right: 0;
    bottom: calc(100% + 8px);
    box-sizing: border-box;
    width: 290px;
    max-width: 100%;
    padding: 9px 11px;
    border-radius: 5px;
    background: #333;
    color: #fff;
    font: 12px/1.4 Arial, sans-serif;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}
.profile-phone-tooltip::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 100%;
    border: 6px solid transparent;
    border-top-color: #333;
}
.profile-phone-control .confirmed.notConfirmed:hover + .profile-phone-tooltip,
.profile-phone-control .confirmed.notConfirmed:focus + .profile-phone-tooltip,
.profile-phone-tooltip:hover {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* STORES profile input wrappers must not inherit the form's row spacing. */
body.page-profile .phone-field .profile-phone-control {
    margin: 0;
}
body.page-profile .phone-field .profile-phone-control .auth-input {
    width: 100%;
    padding-left: 52px;
    padding-right: 38px;
}
body.page-profile .phone-field .profile-phone-feedback {
    margin-top: 3px;
}

.profile-email-feedback .verify-btn::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M3 4h18a1 1 0 011 1v14a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1zm9 9L4 7v11h16V7l-8 6zm0-2 7-5H5l7 5z'/%3E%3C/svg%3E");
}

/* Legacy mobile profile inputs carry vertical margins; anchor status icons to
   the input itself rather than to those margins. */
body.page-profile .profile-personal-data .p-value.profile-phone-control {
    display: block;
}
body.page-profile .profile-personal-data .profile-phone-control > input,
body.page-profile .profile-personal-data .profile-phone-control .iti > input {
    margin-top: 0;
    margin-bottom: 0;
}
body.page-profile .profile-personal-data :is(.email-field, .phone-field) {
    margin-top: 5px;
    margin-bottom: 15px;
}
