/* Cache-busted checkout and account authentication styles: 2026-08-02. */
.rg-phone-auth,
.rg-social-login-section,
.rg-email-auth {
    width: 100%;
    max-width: 520px;
    margin-right: auto;
    margin-left: auto;
    text-transform: none;
}

.rg-phone-auth {
    padding: 20px;
    border: 1px solid #dbe5ef;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.rg-phone-auth__heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.rg-phone-auth .rg-phone-auth__heading h2 {
    margin: 0 0 4px;
    padding: 0;
    border: 0;
    color: #111827;
    font-size: 1.2rem;
    letter-spacing: normal;
    line-height: 1.3;
    text-align: left;
    text-transform: none;
}

.rg-phone-auth__heading p,
.rg-phone-auth__sent-to,
.rg-phone-auth__notice {
    margin: 0;
    color: #5b6878;
    font-size: 0.88rem;
    line-height: 1.5;
}

.rg-phone-auth__form[hidden] {
    display: none !important;
}

.rg-phone-auth__form label {
    display: block;
    margin-bottom: 6px;
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Single phone field: dial code and number share one border, as in the app. */
.rg-phone-auth__field {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    overflow: hidden;
}

.rg-phone-auth__field:focus-within {
    border-color: #004e81;
    box-shadow: 0 0 0 3px rgba(0, 78, 129, 0.12);
}

/* ~80px: wide enough for the longest dial code in the list (+971) plus the
   chevron, and still leaves a full-width number field at 320px. */
.rg-phone-auth__dial {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 0 0 80px;
    padding: 0 8px;
    border-right: 1px solid #e2e8f0;
    color: #111827;
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
}

.rg-phone-auth__chevron {
    flex: none;
    opacity: 0.65;
}

/* The real control, invisible but exactly covering the display above it, so a
   tap opens the native country picker with full names. */
.rg-phone-auth__dial select#rg-phone-country-code {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100%;
    min-height: 0 !important;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    opacity: 0;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

/* The number sits inside the shared border, so it carries none of its own. */
.rg-phone-auth__field input#rg-phone-number {
    flex: 1 1 auto;
    /* Without this a flex item cannot shrink below its intrinsic width, so the
       input stayed ~214px inside a 250px box on a 320px phone and its right
       edge — including the caret at the end of a long number — was clipped. */
    min-width: 0;
    width: auto !important;
    min-height: 46px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.rg-phone-auth__field input#rg-phone-number:focus {
    box-shadow: none !important;
}

.rg-phone-auth select,
.rg-phone-auth input[type="tel"],
.rg-phone-auth input[type="text"],
.rg-phone-auth input[type="email"] {
    width: 100% !important;
    min-height: 48px !important;
    padding: 10px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 9px !important;
    background: #fff !important;
    color: #111827 !important;
    font-size: 16px !important;
}

.rg-phone-auth input::placeholder {
    color: #8a99ad;
    opacity: 1;
}


.rg-phone-auth select:focus,
.rg-phone-auth input:focus {
    border-color: #004e81;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 78, 129, 0.12);
}

.rg-phone-auth__primary {
    width: 100%;
    min-height: 48px;
    margin-top: 10px;
    border: 0 !important;
    border-radius: 9px !important;
    background: #004e81 !important;
    color: #fff !important;
    font-weight: 700 !important;
}

.rg-phone-auth__primary:hover,
.rg-phone-auth__primary:focus {
    background: #003a61 !important;
}

.rg-phone-auth__primary:disabled {
    cursor: wait;
    opacity: 0.68;
}

.rg-phone-auth__sent-to {
    margin-bottom: 12px;
    padding: 9px 11px;
    border-radius: 8px;
    background: #f0f7fb;
    color: #1e4f6f;
}

.rg-phone-auth__link {
    display: block;
    margin: 9px auto 0;
    padding: 4px 8px;
    border: 0;
    background: transparent;
    color: #004e81;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: underline;
}

.rg-phone-auth__link.is-waiting,
.rg-phone-auth__link:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    text-decoration: none;
}

/* One large spaced field: keeps iOS/Android one-time-code autofill working,
   unlike separate per-digit boxes. */
.rg-phone-auth input.rg-phone-auth__code {
    padding-right: 0;
    padding-left: 0.4em;
    font-size: 1.45rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.45em;
    text-align: center;
}

.rg-phone-auth input.rg-phone-auth__code::placeholder {
    color: #b6c1cf;
    font-weight: 400;
}

.rg-phone-auth__hint {
    margin: 10px 0 0;
    color: #5b6878;
    font-size: 0.82rem;
    line-height: 1.5;
    text-align: center;
}

.rg-phone-auth__message {
    min-height: 1.4em;
    margin: 10px 0 0;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
}

.rg-phone-auth__message:empty {
    display: none;
}

.rg-phone-auth__message[data-state="error"] {
    color: #b42318;
}

.rg-phone-auth__message[data-state="success"] {
    color: #157347;
}

.rg-phone-auth__notice {
    margin-top: 7px;
    font-size: 0.75rem;
    text-align: center;
}

.rg-phone-auth + .rg-social-login-section,
.rg-social-login-section + .rg-email-auth {
    margin-top: 14px;
}

.rg-social-login-section .rg-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    color: #5b6878;
    font-size: 0.82rem;
    line-height: 1.4;
    text-align: center;
    text-transform: none;
}

.rg-social-login-section .rg-auth-divider::before,
.rg-social-login-section .rg-auth-divider::after {
    content: "";
    flex: 1 1 auto;
    border-top: 1px solid #dbe5ef;
}

.rg-social-login-section .rg-social-login {
    display: block;
}

.rg-social-login-section .rg-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 10px 16px;
    border: 1px solid #dadce0;
    border-radius: 9px;
    background: #fff;
    color: #202124;
    box-sizing: border-box;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: normal;
    line-height: 1.3;
    text-decoration: none;
    text-transform: none;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.rg-social-login-section .rg-social-btn:hover {
    border-color: #b8bdc4;
    background: #f8f9fa;
    color: #202124;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    text-decoration: none;
}

.rg-social-login-section .rg-social-btn:focus-visible {
    outline: 2px solid #0d5ca6;
    outline-offset: 2px;
}

.rg-social-login-section .rg-social-btn__icon {
    flex: 0 0 20px;
}

.rg-email-auth {
    border: 1px solid #dbe5ef;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.rg-email-auth > summary {
    position: relative;
    padding: 13px 44px 13px 16px;
    color: #004e81;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 700;
    list-style: none;
    text-align: center;
}

.rg-email-auth > summary::-webkit-details-marker {
    display: none;
}

.rg-email-auth > summary::after {
    position: absolute;
    top: 50%;
    right: 17px;
    content: "+";
    font-size: 1.2rem;
    line-height: 1;
    transform: translateY(-50%);
}

.rg-email-auth[open] > summary::after {
    content: "−";
}

.rg-email-auth__body {
    padding: 0 16px 16px;
    border-top: 1px solid #eef2f7;
}

.rg-email-auth__body #customer_login.rg-auth-page {
    margin-top: 16px;
    margin-bottom: 0;
    box-shadow: none;
}

@media (max-width: 520px) {
    .rg-phone-auth {
        padding: 16px 14px;
    }

    .rg-phone-auth__heading {
        gap: 9px;
    }

    .rg-phone-auth .rg-phone-auth__heading h2 {
        font-size: 1.06rem;
    }

    .rg-phone-auth select,
    .rg-phone-auth input,
    .rg-phone-auth__primary {
        min-height: 46px;
    }
}

@media (prefers-color-scheme: dark) {
    .rg-phone-auth,
    .rg-email-auth {
        border-color: #334155;
        background: #111827;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
    }

    .rg-phone-auth__sent-to {
        background: #172b3e;
    }

    .rg-phone-auth .rg-phone-auth__heading h2,
    .rg-phone-auth__form label {
        color: #f8fafc;
    }

    .rg-phone-auth__heading p,
    .rg-phone-auth__notice,
    .rg-phone-auth__hint {
        color: #cbd5e1;
    }

    .rg-phone-auth__sent-to {
        color: #bae6fd;
    }

    .rg-phone-auth select,
    .rg-phone-auth input[type="tel"],
    .rg-phone-auth input[type="text"],
    .rg-phone-auth input[type="email"] {
        border-color: #475569 !important;
        background: #020617 !important;
        color: #f8fafc !important;
    }

    .rg-phone-auth input::placeholder {
        color: #64748b;
    }

    .rg-phone-auth__field {
        border-color: #475569;
        background: #020617;
    }

    .rg-phone-auth__field:focus-within {
        border-color: #7dd3fc;
        box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.18);
    }

    .rg-phone-auth__dial {
        border-right-color: #334155;
        color: #f8fafc;
    }

    /* The brand blue is only legible on a light card: on the dark surface it
       measures 2.03:1, well under the 4.5:1 minimum, which hides exactly the
       controls a stuck customer reaches for (Resend OTP, Change number). */
    .rg-phone-auth__link {
        color: #7dd3fc;
    }

    .rg-phone-auth__link:hover,
    .rg-phone-auth__link:focus {
        color: #bae6fd;
    }


    .rg-email-auth > summary {
        color: #7dd3fc;
    }

    .rg-email-auth__body {
        border-color: #334155;
    }

    .rg-social-login-section .rg-auth-divider {
        color: #cbd5e1;
    }

    .rg-social-login-section .rg-auth-divider::before,
    .rg-social-login-section .rg-auth-divider::after {
        border-color: #475569;
    }

    .rg-social-login-section .rg-social-btn--google {
        border-color: #d1d5db;
        background: #fff;
        color: #111827;
    }

    .rg-social-login-section .rg-social-btn--google:hover {
        border-color: #9ca3af;
        background: #f3f4f6;
        color: #111827;
    }
}
