/* WhatsApp authentication experience. Everything is scoped to the WhatsApp
   auth body class so the shared login/register templates stay unchanged on
   every other platform. */

body.wa-auth-page {
    --wa-auth-primary: var(--primary, #128c7e);
    --wa-auth-secondary: var(--secondary, #25d366);
    --wa-auth-primary-dark: var(--primary-dark, color-mix(in srgb, var(--wa-auth-primary) 78%, #000));
    --wa-auth-primary-soft: var(--primary-soft, color-mix(in srgb, var(--wa-auth-primary) 8%, #fff));
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 8% 10%, color-mix(in srgb, var(--wa-auth-secondary) 14%, transparent), transparent 28rem),
        radial-gradient(circle at 92% 90%, color-mix(in srgb, var(--wa-auth-primary) 12%, transparent), transparent 26rem),
        color-mix(in srgb, var(--wa-auth-primary) 4%, #f3faf7) !important;
    color: #163a34;
}

body.wa-auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    display: block !important;
    pointer-events: none;
    opacity: .35;
    background-image: radial-gradient(color-mix(in srgb, var(--wa-auth-primary) 16%, transparent) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(135deg, #000, transparent 60%);
}

body.wa-auth-page .loader-bg {
    display: none !important;
}

.wa-auth-page .wa-auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* The shared auth templates carry legacy positioning rules on .login_page and
   .register_page. Keep the WhatsApp experience in normal document flow so its
   card remains centered and scrollable at every viewport height. */
.wa-auth-page .wa-login-auth,
.wa-auth-page .wa-register-auth {
    max-width: 100%;
    margin: 0 auto;
}

.wa-auth-page .wa-login-auth .wa-auth-row,
.wa-auth-page .wa-register-auth .wa-auth-row {
    align-items: center;
    justify-content: center;
}

.wa-auth-page .wa-login-page,
.wa-auth-page .wa-register-page {
    position: relative !important;
    inset: auto !important;
    width: 100%;
    max-width: 460px;
    min-height: 0;
    margin: 0 auto;
    padding: 0 !important;
    transform: none !important;
}

.wa-auth-page .wa-register-page {
    flex: 0 0 100%;
    max-width: 1040px;
}

.wa-auth-page .wa-login-page .wa-auth-card,
.wa-auth-page .wa-register-page .wa-auth-card {
    margin: 0;
}

.wa-auth-page .wa-login-page .wa-auth-card > .has_account {
    margin: 0;
    padding: 0 36px 30px;
}

.wa-auth-page .wa-auth-row {
    min-height: 100vh;
    padding: 36px 16px;
}

.wa-auth-page .wa-auth-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 26px;
}

.wa-auth-page .wa-auth-brand-mark {
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, var(--wa-auth-secondary), var(--wa-auth-primary));
    color: #fff;
    font-size: 25px;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--wa-auth-primary) 24%, transparent);
}

.wa-auth-page .wa-auth-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--wa-auth-primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .15em;
    line-height: 1.3;
    text-transform: uppercase;
}

.wa-auth-page .wa-auth-brand-name {
    display: block;
    color: #173b36;
    font-size: clamp(20px, 2.2vw, 25px);
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1.1;
}

.wa-auth-page .wa-auth-card {
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--wa-auth-primary) 12%, transparent) !important;
    border-radius: 24px !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: 0 24px 65px rgba(7, 94, 84, .14) !important;
}

.wa-auth-page .wa-auth-card:hover {
    transform: none;
}

.wa-auth-page .wa-auth-card .card-body {
    padding: 36px;
}

.wa-auth-page .wa-auth-card h1,
.wa-auth-page .wa-auth-card h2 {
    color: #163a34;
    letter-spacing: -.025em;
}

.wa-auth-page .wa-auth-lead {
    margin: -14px 0 25px;
    color: #6a817b;
    font-size: 13px;
    line-height: 1.65;
}

.wa-auth-page .wa-auth-card .form-group {
    margin-bottom: 20px;
}

.wa-auth-page .wa-auth-card .form-group label {
    color: #36564f;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .01em;
}

.wa-auth-page .wa-auth-card .form-control,
.wa-auth-page .wa-auth-card select.form-control {
    min-height: 52px;
    border: 1px solid #d8e8e2;
    border-radius: 12px;
    background: #fbfefd;
    color: #173b36;
    box-shadow: none;
}

.wa-auth-page .wa-auth-card .form-control::placeholder {
    color: #9aaca7;
}

.wa-auth-page .wa-auth-card .form-control:focus,
.wa-auth-page .wa-auth-card select.form-control:focus {
    border-color: var(--wa-auth-primary);
    background: #fff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--wa-auth-primary) 12%, transparent) !important;
}

.wa-auth-page .wa-auth-card .btn-primary,
.wa-auth-page .wa-auth-card #loginsubmit,
.wa-auth-page .wa-auth-card #recover_pass,
.wa-auth-page .wa-auth-card #reactivate_submit,
.wa-auth-page .wa-auth-card #regsubmit {
    min-height: 52px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--wa-auth-primary), var(--wa-auth-primary-dark)) !important;
    box-shadow: 0 10px 20px color-mix(in srgb, var(--wa-auth-primary) 20%, transparent);
    font-size: 14px;
    font-weight: 750;
    letter-spacing: .01em;
}

.wa-auth-page .wa-auth-card .btn-primary:hover,
.wa-auth-page .wa-auth-card #loginsubmit:hover,
.wa-auth-page .wa-auth-card #recover_pass:hover,
.wa-auth-page .wa-auth-card #reactivate_submit:hover,
.wa-auth-page .wa-auth-card #regsubmit:hover {
    background: linear-gradient(135deg, var(--wa-auth-primary-dark), color-mix(in srgb, var(--wa-auth-primary-dark) 82%, #000)) !important;
    box-shadow: 0 13px 24px color-mix(in srgb, var(--wa-auth-primary) 28%, transparent);
}

.wa-auth-page .wa-auth-card .btn-secondary {
    border: 1px solid color-mix(in srgb, var(--wa-auth-primary) 20%, #fff);
    border-radius: 11px;
    background: var(--wa-auth-primary-soft);
    color: var(--wa-auth-primary);
    font-weight: 700;
}

.wa-auth-page .wa-auth-card .btn-secondary:hover {
    background: color-mix(in srgb, var(--wa-auth-primary) 14%, #fff);
    color: var(--wa-auth-primary-dark);
}

.wa-auth-page .wa-auth-card .text-muted {
    color: #718680 !important;
}

.wa-auth-page .wa-auth-card a:not(.btn) {
    color: var(--wa-auth-primary);
    font-weight: 700;
}

.wa-auth-page .wa-auth-card a:not(.btn):hover {
    color: var(--wa-auth-primary-dark);
}

.wa-auth-page .wa-auth-card .alert {
    border: 0;
    border-radius: 12px;
    font-size: 13px;
}

.wa-auth-page .wa-auth-card .alert-danger {
    background: #fff1f0;
    color: #b6443d;
}

.wa-auth-page .wa-auth-card .alert-info {
    background: #edf9f5;
    color: #28695d;
}

.wa-auth-page .wa-auth-card .password-field input {
    padding-right: 48px;
}

.wa-auth-page .wa-auth-card #togglePassword,
.wa-auth-page .wa-auth-card .reveal {
    color: var(--wa-auth-primary) !important;
}

.wa-auth-page .wa-auth-card .has_account {
    color: #718680;
}

.wa-auth-page .wa-auth-card .has_account p {
    font-size: 13px;
}

/* Registration */
.wa-auth-page .wa-register-row {
    padding-top: 30px;
    padding-bottom: 30px;
}

.wa-auth-page .wa-register-card .card-body {
    display: flex;
    padding: 0;
}

.wa-auth-page .wa-register-card .register-side {
    padding: 48px;
}

.wa-auth-page .wa-register-card .register-side.left {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wa-auth-page .wa-register-card .register-side.left {
    flex: 0 0 38%;
    align-items: flex-start;
    background:
        radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--wa-auth-secondary) 22%, transparent), transparent 13rem),
        linear-gradient(155deg, var(--wa-auth-primary-dark) 0%, var(--wa-auth-primary) 62%, color-mix(in srgb, var(--wa-auth-primary-dark) 88%, #000) 100%);
    text-align: left;
}

.wa-auth-page .wa-register-card .register-side.right {
    flex: 1;
}

.wa-auth-page .wa-register-card .wa-auth-brand {
    margin-bottom: 55px;
}

.wa-auth-page .wa-register-card .wa-auth-brand-name,
.wa-auth-page .wa-register-card .wa-auth-eyebrow {
    color: #fff;
}

.wa-auth-page .wa-register-card .wa-auth-brand-eyebrow {
    color: rgba(255, 255, 255, .72);
}

.wa-auth-page .wa-register-card .register-welcome {
    margin-bottom: 28px;
}

.wa-auth-page .wa-register-card .register-welcome h1 {
    margin-bottom: 13px;
    color: #fff;
    font-size: clamp(2rem, 3vw, 2.7rem);
    line-height: 1.08;
}

.wa-auth-page .wa-register-card .register-welcome p {
    max-width: 300px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
    line-height: 1.7;
}

.wa-auth-page .wa-register-benefits {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wa-auth-page .wa-register-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, .88);
    font-size: 12px;
    line-height: 1.4;
}

.wa-auth-page .wa-register-benefits i {
    color: #8bf0b6;
    font-size: 13px;
}

.wa-auth-page .wa-register-card .right > h2 {
    margin-bottom: 7px;
    font-size: 27px;
}

.wa-auth-page .wa-register-subtitle {
    margin: 0 0 27px;
    color: #718680;
    font-size: 13px;
    line-height: 1.6;
}

.wa-auth-page .wa-register-card .register-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
    margin: 0;
}

.wa-auth-page .wa-register-card .register-form-row > .form-group {
    min-width: 0;
    max-width: none;
    padding: 0;
}

.wa-auth-page .wa-register-card .register-form-row > .form-group.full-width {
    grid-column: 1 / -1;
}

.wa-auth-page .wa-register-card .password-field {
    position: relative;
}

.wa-auth-page .wa-register-card .password-field .reveal {
    position: absolute;
    top: 50%;
    right: 12px;
    z-index: 2;
    padding: 0;
    border: 0;
    color: var(--wa-auth-primary);
    background: transparent;
    transform: translateY(-50%);
}

.wa-auth-page .wa-register-card .password-field input {
    padding-right: 46px;
}

.wa-auth-page .wa-register-card .form-text,
.wa-auth-page .wa-register-card .username-helper,
.wa-auth-page .wa-register-card #password_strength {
    color: #718680 !important;
    font-size: 11px !important;
}

.wa-auth-page .wa-register-card .text-success {
    color: var(--wa-auth-primary) !important;
}

/* Registration unavailable / migration states use the same card shell. */
.wa-auth-page .wa-register-card .info-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 42px !important;
    text-align: center;
}

.wa-auth-page .wa-register-card .info-notice-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(145deg, var(--wa-auth-secondary), var(--wa-auth-primary));
    font-size: 20px;
}

.wa-auth-page .wa-register-card .info-notice h2 {
    margin-bottom: 10px;
}

.wa-auth-page .wa-register-card .info-notice p {
    max-width: 440px;
    color: #718680;
    line-height: 1.65;
}

.wa-auth-page .wa-register-card .info-notice .has_account {
    width: 100%;
    margin-top: 12px;
    padding-top: 20px;
    border-top: 1px solid #e6f0ec;
}

@media (max-width: 767.98px) {
    .wa-auth-page .wa-auth-row {
        min-height: auto;
        padding: 22px 10px;
    }

    .wa-auth-page .wa-auth-card .card-body,
    .wa-auth-page .wa-register-card .register-side {
        padding: 27px 22px;
    }

    .wa-auth-page .wa-register-card .card-body {
        display: block;
    }

    .wa-auth-page .wa-register-card .register-form-row {
        display: block;
    }

    .wa-auth-page .wa-register-card .register-side.left {
        align-items: stretch;
    }

    .wa-auth-page .wa-register-card .info-notice {
        padding: 32px 22px !important;
    }

    .wa-auth-page .wa-register-card .wa-auth-brand {
        margin-bottom: 28px;
    }

    .wa-auth-page .wa-register-card .register-welcome h1 {
        font-size: 2rem;
    }
}

@media (max-width: 420px) {
    .wa-auth-page .wa-auth-card .card-body,
    .wa-auth-page .wa-register-card .register-side {
        padding: 23px 17px;
    }

    .wa-auth-page .wa-register-card .register-form-row > .form-group {
        flex-basis: 100%;
        max-width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wa-auth-page *,
    .wa-auth-page *::before,
    .wa-auth-page *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
