:root {
    --br-otp-green: #0f5b4d;
    --br-otp-green-2: #11735f;
    --br-otp-green-soft: #edf6f1;
    --br-otp-cream: #f6f1ea;
    --br-otp-cream-2: #fffaf4;
    --br-otp-text: #252b2a;
    --br-otp-muted: #7c817d;
    --br-otp-border: rgba(15, 91, 77, .14);
    --br-otp-shadow: 0 24px 70px rgba(28, 42, 36, .11);
    --br-otp-shadow-soft: 0 12px 34px rgba(28, 42, 36, .08);
    --br-otp-radius: 30px;
}

.br-otp-auth-wrap,
.br-otp-auth-wrap * {
    box-sizing: border-box;
}

.br-otp-auth-wrap {
    width: 100%;
    min-height: 560px;
    position: relative;
    direction: rtl;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 5vw, 72px) 16px;
    overflow: hidden;
    isolation: isolate;
    font-family: inherit;
    color: var(--br-otp-text);
}

.br-otp-auth-bg {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(0);
    opacity: .85;
    z-index: -1;
}

.br-otp-auth-bg--one {
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(17, 115, 95, .16), rgba(17, 115, 95, 0) 70%);
    right: max(6vw, 20px);
    top: 8%;
}

.br-otp-auth-bg--two {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(214, 175, 111, .18), rgba(214, 175, 111, 0) 70%);
    left: max(6vw, 20px);
    bottom: 2%;
}

.br-otp-auth-card {
    width: min(100%, 490px);
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 252, 248, .96));
    border: 1px solid rgba(15, 91, 77, .12);
    border-radius: var(--br-otp-radius);
    box-shadow: var(--br-otp-shadow);
    padding: clamp(24px, 4.5vw, 42px);
    overflow: hidden;
}

.br-otp-auth-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, transparent, var(--br-otp-green), transparent);
    opacity: .9;
}

.br-otp-auth-card--logged-in {
    text-align: center;
}

.br-otp-auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--br-otp-green);
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 24px;
}

.br-otp-auth-logo {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #f5fbf7, #edf5ef);
    box-shadow: inset 0 0 0 1px rgba(15, 91, 77, .08), 0 12px 28px rgba(15, 91, 77, .1);
}

.br-otp-auth-heading {
    margin-bottom: 24px;
}

.br-otp-auth-eyebrow {
    display: block;
    color: var(--br-otp-green);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -.02em;
}

.br-otp-auth-title {
    margin: 0 0 12px;
    color: var(--br-otp-text);
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 950;
    line-height: 1.18;
    letter-spacing: -.05em;
}

.br-otp-auth-text {
    margin: 0;
    color: var(--br-otp-muted);
    font-size: 15px;
    line-height: 2;
}

.br-otp-auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: brOtpFadeUp .32s ease both;
}

.br-otp-auth-label {
    display: block;
    color: var(--br-otp-text);
    font-size: 14px;
    font-weight: 800;
    margin-bottom: -4px;
}

.br-otp-auth-field {
    position: relative;
    display: flex;
    align-items: center;
}

.br-otp-auth-field-icon {
    position: absolute;
    right: 18px;
    color: var(--br-otp-green);
    z-index: 1;
    display: inline-flex;
}

.br-otp-auth-input {
    width: 100% !important;
    height: 62px !important;
    min-height: 62px !important;
    border: 1px solid var(--br-otp-border) !important;
    border-radius: 20px !important;
    background: #fff !important;
    color: var(--br-otp-text) !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    outline: none !important;
    box-shadow: 0 10px 24px rgba(28, 42, 36, .04) !important;
    padding: 0 54px 0 18px !important;
    text-align: left !important;
    direction: ltr !important;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease !important;
}

.br-otp-auth-input:focus {
    border-color: rgba(15, 91, 77, .5) !important;
    box-shadow: 0 0 0 4px rgba(15, 91, 77, .08), 0 10px 24px rgba(28, 42, 36, .04) !important;
}

.br-otp-auth-button,
.br-otp-auth-button:visited {
    width: 100%;
    min-height: 60px;
    border: 0 !important;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--br-otp-green), var(--br-otp-green-2)) !important;
    color: #fff !important;
    font-size: 16px;
    font-weight: 900;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 18px 34px rgba(15, 91, 77, .24);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
    padding: 0 18px;
}

.br-otp-auth-button:hover,
.br-otp-auth-button:focus {
    transform: translateY(-2px);
    box-shadow: 0 22px 42px rgba(15, 91, 77, .3);
    color: #fff !important;
}

.br-otp-auth-button:disabled {
    cursor: not-allowed;
    opacity: .72;
    transform: none;
}

.br-otp-auth-loader {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    display: none;
    animation: brOtpSpin .75s linear infinite;
}

.br-otp-auth-button--loading .br-otp-auth-loader {
    display: inline-block;
}

.br-otp-auth-notice {
    border-radius: 18px;
    padding: 13px 15px;
    font-size: 14px;
    line-height: 1.8;
    font-weight: 700;
    margin-bottom: 16px;
}

.br-otp-auth-notice--success {
    color: #0f5b4d;
    background: rgba(15, 91, 77, .08);
    border: 1px solid rgba(15, 91, 77, .12);
}

.br-otp-auth-notice--error {
    color: #9f2f25;
    background: rgba(159, 47, 37, .08);
    border: 1px solid rgba(159, 47, 37, .12);
}

.br-otp-auth-change-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--br-otp-green-soft);
    color: var(--br-otp-text);
    font-size: 14px;
    line-height: 1.8;
}

.br-otp-auth-change-row strong {
    direction: ltr;
    display: inline-block;
}

.br-otp-auth-change-row button,
.br-otp-auth-resend {
    border: 0;
    background: transparent;
    color: var(--br-otp-green);
    font-weight: 900;
    cursor: pointer;
    padding: 6px 4px;
    white-space: nowrap;
}

.br-otp-auth-resend {
    width: 100%;
    min-height: 44px;
    border-radius: 16px;
    background: rgba(15, 91, 77, .06);
}

.br-otp-auth-resend:disabled {
    color: var(--br-otp-muted);
    cursor: not-allowed;
}

.br-otp-auth-code {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    direction: ltr;
}

.br-otp-auth-code-input {
    width: 100% !important;
    aspect-ratio: 1 / 1;
    min-height: 56px !important;
    border: 1px solid var(--br-otp-border) !important;
    border-radius: 18px !important;
    background: #fff !important;
    color: var(--br-otp-text) !important;
    font-size: 24px !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    text-align: center !important;
    outline: none !important;
    box-shadow: 0 10px 24px rgba(28, 42, 36, .04) !important;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease !important;
    padding: 0 !important;
}

.br-otp-auth-code-input:focus {
    border-color: rgba(15, 91, 77, .5) !important;
    box-shadow: 0 0 0 4px rgba(15, 91, 77, .08), 0 10px 24px rgba(28, 42, 36, .04) !important;
    transform: translateY(-1px);
}

.br-otp-auth-test-hint {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(214, 175, 111, .14);
    color: #7b5b2d;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.8;
}

.br-otp-auth-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(15, 91, 77, .08);
    color: var(--br-otp-muted);
    font-size: 13px;
    line-height: 1.9;
    text-align: center;
}

body.woocommerce-account .br-otp-auth-wrap {
    min-height: 520px;
    padding-top: 36px;
    padding-bottom: 36px;
}

body.woocommerce-account .woocommerce .br-otp-auth-wrap,
body.woocommerce-account .wd-my-account-sidebar + .woocommerce-MyAccount-content .br-otp-auth-wrap {
    width: 100%;
}

@keyframes brOtpSpin {
    to { transform: rotate(360deg); }
}

@keyframes brOtpFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .br-otp-auth-wrap {
        min-height: auto;
        padding: 28px 14px;
        align-items: flex-start;
    }

    .br-otp-auth-card {
        border-radius: 26px;
        padding: 24px 18px;
        box-shadow: var(--br-otp-shadow-soft);
    }

    .br-otp-auth-brand {
        margin-bottom: 20px;
    }

    .br-otp-auth-logo {
        width: 44px;
        height: 44px;
        border-radius: 16px;
    }

    .br-otp-auth-title {
        font-size: 31px;
    }

    .br-otp-auth-input,
    .br-otp-auth-button {
        min-height: 56px !important;
        height: 56px !important;
        border-radius: 18px !important;
    }

    .br-otp-auth-code {
        gap: 8px;
    }

    .br-otp-auth-code-input {
        min-height: 52px !important;
        border-radius: 16px !important;
        font-size: 22px !important;
    }
}

@media (max-width: 380px) {
    .br-otp-auth-card {
        padding-inline: 14px;
    }

    .br-otp-auth-code {
        gap: 6px;
    }

    .br-otp-auth-code-input {
        min-height: 48px !important;
        border-radius: 14px !important;
    }
}

.br-otp-auth-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 18px;
    padding: 6px;
    border-radius: 18px;
    background: rgba(15, 91, 77, .055);
    border: 1px solid rgba(15, 91, 77, .08);
}

.br-otp-auth-step {
    min-height: 36px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    color: var(--br-otp-muted);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.4;
    white-space: nowrap;
    transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}

.br-otp-auth-step--active {
    color: #fff;
    background: linear-gradient(135deg, var(--br-otp-green), var(--br-otp-green-2));
    box-shadow: 0 10px 20px rgba(15, 91, 77, .16);
}

.br-otp-auth-step--done {
    color: var(--br-otp-green);
    background: rgba(255, 255, 255, .72);
}

.br-otp-auth-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.br-otp-auth-profile-field {
    min-width: 0;
}

.br-otp-auth-input--rtl {
    direction: rtl !important;
    text-align: right !important;
}

.br-otp-auth-input--email {
    direction: ltr !important;
    text-align: left !important;
}

.br-otp-auth-optional {
    color: var(--br-otp-muted);
    font-size: 12px;
    font-weight: 800;
    margin-right: 4px;
}

@media (max-width: 520px) {
    .br-otp-auth-steps {
        gap: 6px;
        padding: 5px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .br-otp-auth-steps::-webkit-scrollbar {
        display: none;
    }

    .br-otp-auth-step {
        min-width: max-content;
        padding-inline: 12px;
        scroll-snap-align: center;
    }

    .br-otp-auth-profile-grid {
        grid-template-columns: 1fr;
    }
}

body.br-otp-checkout-locked {
    overflow: hidden;
}

body.br-otp-checkout-locked .woocommerce-checkout,
body.br-otp-checkout-locked form.checkout,
body.br-otp-checkout-locked .checkout_coupon,
body.br-otp-checkout-locked .woocommerce-form-coupon-toggle,
body.br-otp-checkout-locked .woocommerce-form-login-toggle {
    pointer-events: none;
    user-select: none;
    filter: blur(1.8px);
}

.br-otp-checkout-modal,
.br-otp-checkout-modal * {
    box-sizing: border-box;
}

.br-otp-checkout-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    direction: rtl;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    color: var(--br-otp-text);
}

.br-otp-checkout-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 22, .56);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.br-otp-checkout-modal__panel {
    width: min(100%, 560px);
    max-height: calc(100vh - 36px);
    overflow: auto;
    position: relative;
    background: linear-gradient(180deg, rgba(255, 252, 248, .98), rgba(246, 241, 234, .97));
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 34px;
    box-shadow: 0 34px 90px rgba(0, 0, 0, .22);
    padding: 14px;
    scrollbar-width: thin;
}

.br-otp-checkout-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 10px 0;
    margin-bottom: -10px;
}

.br-otp-checkout-modal__header span {
    display: block;
    color: var(--br-otp-green);
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 4px;
}

.br-otp-checkout-modal__header strong {
    display: block;
    color: var(--br-otp-text);
    font-size: 18px;
    font-weight: 950;
    letter-spacing: -.03em;
}

.br-otp-checkout-modal__cart,
.br-otp-checkout-modal__cart:visited {
    flex: 0 0 auto;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(15, 91, 77, .12);
    color: var(--br-otp-green) !important;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none !important;
}

.br-otp-checkout-modal .br-otp-auth-wrap {
    min-height: 0;
    padding: 18px 0 0;
}

.br-otp-checkout-modal .br-otp-auth-bg {
    display: none;
}

.br-otp-checkout-modal .br-otp-auth-card {
    width: 100%;
    box-shadow: none;
    border-color: rgba(15, 91, 77, .10);
}

@media (max-width: 640px) {
    .br-otp-checkout-modal {
        align-items: flex-end;
        padding: 10px;
    }

    .br-otp-checkout-modal__panel {
        max-height: calc(100vh - 20px);
        border-radius: 28px;
    }

    .br-otp-checkout-modal__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .br-otp-checkout-modal__cart {
        width: 100%;
    }
}

/* Hard-hide inactive OTP steps/forms even when the theme overrides the HTML hidden attribute. */
.br-otp-auth-wrap [hidden] {
    display: none !important;
}
