/* ==========================================================================
   Phone OTP Login Styles
   ========================================================================== */

:root {
    --pauth-primary: #74308f;
    --pauth-primary-dark: #56216f;
    --pauth-primary-soft: rgba(116, 48, 143, 0.16);
    --pauth-ink: #25152f;
    --pauth-muted: #7a6d82;
    --pauth-line: rgba(111, 80, 130, 0.22);
    --pauth-glass: rgba(255, 255, 255, 0.42);
    --pauth-glass-strong: rgba(255, 255, 255, 0.72);
    --pauth-shadow: 0 24px 70px rgba(38, 20, 55, 0.28);
}

body:has(#pauth_login_panel) {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 20%, rgba(116, 48, 143, 0.14), transparent 30%),
        radial-gradient(circle at 82% 72%, rgba(63, 148, 185, 0.13), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, #fbf9ff 48%, #f7fbff 100%);
}

body:has(#pauth_login_panel) .oe_login_form:not(#pauth_login_panel),
body:has(#pauth_login_panel) .o_database_list {
    display: none !important;
}

body:has(#pauth_login_panel) main,
body:has(#pauth_login_panel) #wrapwrap,
body:has(#pauth_login_panel) .oe_website_login_container {
    min-height: 100vh;
}

body:has(#pauth_login_panel) .oe_website_login_container {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 22vh 16px 32px;
}

.pauth-login-panel {
    width: min(100%, 526px);
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    position: relative;
    margin: 0 auto;
    padding: 54px 64px 44px;
    color: var(--pauth-ink);
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.50), rgba(255, 255, 255, 0.18)),
        linear-gradient(180deg, rgba(116, 48, 143, 0.08), rgba(63, 148, 185, 0.05));
    box-shadow:
        0 28px 76px rgba(78, 47, 103, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(255, 255, 255, 0.26);
    backdrop-filter: blur(34px) saturate(1.55);
    -webkit-backdrop-filter: blur(34px) saturate(1.55);
    transition: width 0.24s ease, padding 0.24s ease, background 0.24s ease;
}

.pauth-login-panel::before {
    content: "\f023";
    font-family: FontAwesome;
    position: absolute;
    top: -32px;
    left: 38%;
    width: 64px;
    height: 64px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--pauth-primary);
    font-size: 1.34rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.44);
    border: 1px solid rgba(255, 255, 255, 0.56);
    box-shadow: 0 12px 28px rgba(60, 28, 82, 0.24);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.pauth-login-panel[data-active-step$="_otp"],
.pauth-login-panel[data-active-step$="reset_otp"] {
    width: min(100%, 526px);
    padding: 44px 56px 40px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow:
        0 18px 50px rgba(42, 28, 58, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.pauth-login-panel[data-active-step="pauth_step_password"],
.pauth-login-panel[data-active-step="pauth_step_new_password"],
.pauth-login-panel[data-active-step="pauth_step_email_password"],
.pauth-login-panel[data-active-step="pauth_step_email_new_password"] {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.50), rgba(255, 255, 255, 0.18)),
        linear-gradient(180deg, rgba(116, 48, 143, 0.08), rgba(63, 148, 185, 0.05));
    box-shadow:
        0 28px 76px rgba(78, 47, 103, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(255, 255, 255, 0.26);
}

.pauth-login-panel[data-active-step$="_otp"]::before,
.pauth-login-panel[data-active-step$="reset_otp"]::before {
    display: none;
}

.pauth-login-panel h5 {
    margin-top: 4px;
    margin-bottom: 26px !important;
    color: var(--pauth-ink);
    font-size: 1.18rem;
    font-weight: 800 !important;
}

.pauth-email-form {
    margin-top: 50px;
}

.pauth-step {
    width: 100%;
    animation: pauth-fadein 0.22s ease;
}

#pauth_phone_section,
#pauth_email_section,
.pauth-login-panel form,
.pauth-login-panel .mb-3,
.pauth-login-panel .d-grid,
.pauth-login-panel .input-group,
#pauth_method_selector {
    width: 100%;
}

@keyframes pauth-fadein {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

#pauth_method_selector {
    margin-bottom: 30px !important;
}

#pauth_method_selector .btn-group {
    width: 100%;
    display: flex;
    height: 52px;
    padding: 2px;
    border: 1px solid var(--pauth-line);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.74),
        0 10px 24px rgba(67, 38, 88, 0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

#pauth_method_selector .btn {
    flex: 1 1 0;
    border: 0;
    border-radius: 6px !important;
    color: var(--pauth-primary);
    font-size: 1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#pauth_method_selector .btn-check:checked + .btn {
    color: var(--pauth-primary-dark);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 8px 18px rgba(86, 33, 111, 0.12);
}

.pauth-login-panel .form-label {
    color: var(--pauth-ink);
    font-size: 0.94rem;
    font-weight: 700;
}

.pauth-login-panel .form-text,
.pauth-login-panel .text-muted {
    color: var(--pauth-muted) !important;
}

.pauth-login-panel .form-control,
.pauth-country-btn {
    min-height: 50px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    border: 1px solid rgba(111, 80, 130, 0.18);
    border-radius: 6px;
    color: var(--pauth-ink);
    background: rgba(255, 255, 255, 0.66);
    box-shadow:
        0 10px 24px rgba(69, 41, 91, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.pauth-login-panel .form-control::placeholder {
    color: rgba(80, 65, 91, 0.52);
}

.pauth-login-panel .form-control:focus,
.pauth-country-btn:focus {
    border-color: rgba(116, 48, 143, 0.54);
    box-shadow: 0 0 0 0.18rem rgba(116, 48, 143, 0.16);
}

.pauth-login-panel .btn-primary {
    min-height: 50px;
    width: 100%;
    max-width: none;
    border: 0;
    border-radius: 6px;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(180deg, var(--pauth-primary), var(--pauth-primary-dark));
    box-shadow: 0 14px 26px rgba(86, 33, 111, 0.26);
}

.pauth-login-panel .btn-primary:hover,
.pauth-login-panel .btn-primary:focus {
    background: linear-gradient(180deg, #8538a1, #61257d);
}

.pauth-login-panel .btn-link,
.pauth-login-panel a {
    color: var(--pauth-primary);
    font-weight: 700;
    text-decoration: none;
}

.pauth-login-panel .btn-link:hover,
.pauth-login-panel a:hover {
    color: var(--pauth-primary-dark);
}

#pauth_phone_section .input-group {
    direction: ltr !important;
    flex-direction: row !important;
}

#pauth_phone_section .dropdown {
    order: 0;
}

#pauth_phone_input {
    order: 1;
}

.pauth-country-btn {
    min-width: 118px;
    font-size: 0.96rem;
    white-space: nowrap;
}

.pauth-country-list {
    max-height: 280px;
    min-width: 230px;
    overflow-y: auto;
    border: 1px solid rgba(111, 80, 130, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 36px rgba(37, 21, 47, 0.18);
}

.pauth-country-item {
    font-size: 0.9rem;
}

#pauth_phone_input,
#pauth_email_input,
#pauth_otp_phone_display,
#pauth_pw_phone_display,
#pauth_otp_email_display,
#pauth_pw_email_display {
    direction: ltr;
    text-align: left;
}

#pauth_otp_phone_display,
#pauth_pw_phone_display,
#pauth_otp_email_display,
#pauth_pw_email_display {
    color: var(--pauth-ink);
    font-size: 0.98rem;
    font-weight: 800;
    text-align: center;
}

.pauth-login-panel[data-active-step$="_otp"] #pauth_method_selector,
.pauth-login-panel[data-active-step$="reset_otp"] #pauth_method_selector,
.pauth-login-panel[data-active-step$="_otp"] > h5,
.pauth-login-panel[data-active-step$="reset_otp"] > h5 {
    display: none;
}

.pauth-login-panel[data-active-step$="_otp"] .pauth-step > p:first-child,
.pauth-login-panel[data-active-step$="reset_otp"] .pauth-step > p:first-child {
    color: var(--pauth-ink) !important;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.9;
}

#pauth_otp_boxes,
#pauth_reset_otp_boxes,
#pauth_email_otp_boxes,
#pauth_email_reset_otp_boxes {
    direction: ltr !important;
    flex-direction: row !important;
    gap: 10px !important;
    margin-top: 20px;
    margin-bottom: 22px !important;
}

.pauth-otp-digit,
.pauth-reset-otp-digit,
.pauth-email-otp-digit,
.pauth-email-reset-otp-digit {
    width: 44px;
    height: 46px;
    flex: 0 0 44px;
    padding: 0;
    border: 1px solid rgba(124, 125, 140, 0.25);
    border-radius: 7px;
    color: var(--pauth-primary-dark);
    font-size: 1.34rem;
    font-weight: 800;
    text-align: center;
    direction: ltr !important;
    unicode-bidi: isolate;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 8px 18px rgba(56, 43, 70, 0.06);
    -moz-appearance: textfield;
}

.pauth-otp-digit:focus,
.pauth-reset-otp-digit:focus,
.pauth-email-otp-digit:focus,
.pauth-email-reset-otp-digit:focus {
    border-color: var(--pauth-primary);
    box-shadow: 0 0 0 0.16rem rgba(116, 48, 143, 0.18), 0 10px 22px rgba(116, 48, 143, 0.10);
    outline: none;
}

.pauth-otp-digit::-webkit-outer-spin-button,
.pauth-otp-digit::-webkit-inner-spin-button,
.pauth-reset-otp-digit::-webkit-outer-spin-button,
.pauth-reset-otp-digit::-webkit-inner-spin-button,
.pauth-email-otp-digit::-webkit-outer-spin-button,
.pauth-email-otp-digit::-webkit-inner-spin-button,
.pauth-email-reset-otp-digit::-webkit-outer-spin-button,
.pauth-email-reset-otp-digit::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#pauth_timer,
#pauth_reset_timer,
#pauth_email_timer,
#pauth_email_reset_timer {
    color: var(--pauth-primary-dark);
}

.pauth-countdown-ring {
    --pauth-progress: 360deg;
    width: 70px;
    height: 70px;
    margin: 2px auto 12px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.96) 0 54%, transparent 55%),
        conic-gradient(var(--pauth-primary) var(--pauth-progress), rgba(116, 48, 143, 0.10) 0);
    color: var(--pauth-ink) !important;
    font-size: 1rem !important;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 12px 24px rgba(86, 33, 111, 0.13);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

#pauth_resend_link,
#pauth_reset_resend_link,
#pauth_email_resend_link,
#pauth_email_reset_resend_link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    color: var(--pauth-muted);
    font-size: 0.86rem;
}

.pauth-toggle-pw {
    min-width: 42px;
    color: var(--pauth-primary);
    background: rgba(255, 255, 255, 0.70);
}

#pauth_message {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(50, 29, 62, 0.12);
}

@media (max-width: 480px) {
    body:has(#pauth_login_panel) .oe_website_login_container {
        padding: 16vh 24px 20px;
    }

    .pauth-login-panel,
    .pauth-login-panel[data-active-step$="_otp"],
    .pauth-login-panel[data-active-step$="reset_otp"] {
        width: calc(100vw - 48px);
        max-width: 390px;
        padding: 46px 14px 30px;
    }

    .pauth-login-panel::before {
        left: 36%;
    }

    #pauth_method_selector .btn-group,
    .pauth-login-panel .form-control,
    .pauth-login-panel .btn-primary {
        width: 100%;
    }

    .pauth-country-btn {
        min-width: 112px;
    }

    #pauth_otp_boxes,
    #pauth_reset_otp_boxes,
    #pauth_email_otp_boxes,
    #pauth_email_reset_otp_boxes {
        gap: 7px !important;
    }

    .pauth-otp-digit,
    .pauth-reset-otp-digit,
    .pauth-email-otp-digit,
    .pauth-email-reset-otp-digit {
        width: 38px;
        height: 44px;
        flex-basis: 38px;
        font-size: 1.2rem;
    }
}
