/* ========================
   Design System Tokens (v2)
   Ported from FormFire.WebApps.Agency _variables-new.scss
   ======================== */

:root {
    /* Colors */
    --navy:        #213a5c;
    --text:        #1e293b;
    --text-muted:  #64748b;
    --border:      #e5e7eb;
    --surface:     #f8fafc;
    --white:       #ffffff;

    /* Status */
    --green:       #15803d;
    --green-light: #f0fdf4;
    --green-dark:  #058744;
    --amber:       #b45309;
    --amber-light: #fffbeb;
    --red:         #ef4444;
    --red-light:   #fef2f2;

    /* Interactive */
    --hover-bg:    #f1f5f9;
    --focus-ring:  rgba(33, 58, 92, 0.08);

    /* Border radius */
    --radius-sm:   4px;
    --radius:      8px;
    --radius-lg:   12px;
    --radius-pill: 999px;

    /* Shadows */
    --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.06);

    /* Typography */
    --font-xs:     0.72rem;
    --font-sm:     0.75rem;
    --font-body:   0.82rem;
    --font-md:     0.85rem;
    --font-lg:     1rem;
    --font-xl:     1.25rem;

    /* Spacing */
    --space-xs:    4px;
    --space-sm:    8px;
    --space-md:    12px;
    --space-lg:    16px;
    --space-xl:    24px;
    --space-xxl:   32px;
}


/* ========================
   Reset & Base
   ======================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: var(--text);
    background-color: var(--surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
}

a {
    color: var(--navy);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* SVG icon host (mirrors agency app-icon :host) */
[data-icon] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-icon] svg {
    display: block;
}


/* ========================
   Auth page layout
   ======================== */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: var(--space-xl);
}


/* ========================
   Split-screen login layout
   ======================== */

.auth-split {
    display: flex;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Override auth-page padding when split layout is used */
.auth-page:has(.auth-split) {
    padding: 0;
}

/* --- Brand panel (left) --- */
.auth-split__brand {
    flex: 0 0 45%;
    background: linear-gradient(160deg, #1a3050 0%, var(--navy) 40%, #2a4a6c 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

/* Decorative floating shapes */
.auth-split__brand::before {
    content: '';
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(5, 135, 68, 0.12) 0%, transparent 70%);
    top: -80px;
    right: -100px;
    pointer-events: none;
}

.auth-split__brand::after {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(126, 184, 232, 0.10) 0%, transparent 70%);
    bottom: -60px;
    left: -80px;
    pointer-events: none;
}

/* Logo image in a frosted glass card (used when logo PNG is present) */
.auth-split__brand-logo {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    padding: 20px 28px;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.auth-split__brand-logo img {
    width: 13rem;
    display: block;
}

/* Brand logos — horizontal, large */
.auth-split__brand-logos {
    display: flex;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.auth-split__brand-logos-img {
    display: block;
    height: 5rem;
    width: auto;
    filter: brightness(0) invert(1);
}

.auth-split__brand-logos-divider {
    width: 1px;
    height: 4rem;
    background: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

/* Tagline — hero text */
.auth-split__brand-tagline {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    position: relative;
    z-index: 1;
    max-width: 18rem;
    letter-spacing: -0.02em;
    margin-top: auto;
}

.auth-split__brand-tagline em {
    font-style: normal;
    color: #4ade80;
}

/* Subtitle */
.auth-split__brand-sub {
    font-size: var(--font-md);
    color: rgba(255, 255, 255, 0.5);
    margin-top: var(--space-lg);
    position: relative;
    z-index: 1;
    max-width: 18rem;
    line-height: 1.7;
    margin-bottom: auto;
}

/* Bottom accent bar */
.auth-split__brand-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green-dark), #7EB8E8, var(--green-dark));
    z-index: 1;
}

/* --- Form panel (right) --- */
.auth-split__form {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-xxl);
    background: var(--white);
}

.auth-split__form-inner {
    width: 100%;
    max-width: 24rem;
}

/* Title inside split form — left-aligned, larger */
.auth-split__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 var(--space-xs);
}

.auth-split__subtitle {
    font-size: var(--font-md);
    color: var(--text-muted);
    margin: 0 0 var(--space-xxl);
}

/* Full-width primary button in split layout */
.auth-split__submit {
    width: 100%;
    padding: 10px 24px;
    font-size: var(--font-md);
    margin-top: var(--space-sm);
}

/* Forgot links row in split layout */
.auth-split__forgot {
    text-align: center;
    margin-top: var(--space-lg);
}

/* Mobile logo — hidden on desktop, shown when brand panel is gone */
.auth-split__mobile-logo {
    display: none;
    width: 12rem;
    margin: 0 auto var(--space-xl);
}

.auth-split__mobile-logo img {
    width: 100%;
    display: block;
}

/* --- Split-screen responsive --- */
@media only screen and (max-width: 900px) {
    .auth-split {
        flex-direction: column;
    }

    .auth-split__brand {
        display: none;
    }

    .auth-split__mobile-logo {
        display: block;
    }

    .auth-split__form {
        min-height: 100vh;
        padding: var(--space-xl);
    }

    .auth-split__title {
        text-align: center;
    }

    .auth-split__subtitle {
        text-align: center;
    }
}


/* ========================
   Auth Card — shell
   ======================== */

.auth-card {
    background: var(--white);
    width: 100%;
    max-width: 30rem;
    padding: var(--space-xxl);
    margin: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.auth-card--wide {
    max-width: 40rem;
}


/* ========================
   Logo
   ======================== */

.auth-card__logo {
    width: 15rem;
    margin: 0 auto var(--space-xl);
}

.auth-card__logo img {
    width: 100%;
    display: block;
}


/* ========================
   Typography
   ======================== */

.auth-card__title {
    font-size: var(--font-xl);
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin: 0 0 var(--space-xl);
}

.auth-card__subtitle {
    font-size: var(--font-body);
    color: var(--text-muted);
    text-align: center;
    margin: calc(-1 * var(--space-lg)) 0 var(--space-xl);
}

.auth-card__text {
    font-size: var(--font-body);
    color: var(--text);
    text-align: center;
    margin: 0 0 var(--space-lg);
}

.auth-card__text--muted {
    color: var(--text-muted);
}


/* ========================
   Form fields
   ======================== */

.auth-field {
    margin-bottom: var(--space-lg);
}

.auth-field__label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.auth-field__wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-field__icon {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.auth-field__input {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--font-md);
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field__input::placeholder {
    color: #cbd5e1;
}

.auth-field__input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.auth-field__input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--surface);
}

.auth-field__input--has-toggle {
    padding-right: 40px;
}

.auth-field__toggle {
    position: absolute;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.1s, background 0.1s;
    padding: 0;
}

.auth-field__toggle:hover {
    color: var(--text);
    background: var(--surface);
}

.auth-field__toggle svg {
    display: block;
}

.auth-field__error {
    font-size: var(--font-sm);
    color: var(--red);
    margin-top: var(--space-xs);
}

.auth-field__helper {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}


/* ========================
   Buttons
   ======================== */

.auth-card__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.auth-card__actions--between {
    justify-content: space-between;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 24px;
    border-radius: var(--radius);
    font-size: var(--font-md);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.12s, box-shadow 0.12s, color 0.12s;
    text-decoration: none;
    line-height: 1.5;
}

.auth-btn:hover {
    text-decoration: none;
}

.auth-btn--primary {
    border: none;
    background: var(--navy);
    color: var(--white);
}

.auth-btn--primary:hover {
    background: #1a2f4d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.auth-btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-btn--secondary {
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
}

.auth-btn--secondary:hover {
    background: var(--surface);
}

.auth-btn--link {
    border: none;
    background: none;
    color: var(--navy);
    padding: 6px 8px;
    font-weight: 500;
}

.auth-btn--link:hover {
    text-decoration: underline;
}


/* ========================
   Alerts
   ======================== */

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius);
    font-size: var(--font-body);
    margin-bottom: var(--space-lg);
}

.auth-alert--info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid rgba(30, 64, 175, 0.15);
}

.auth-alert--success {
    background: var(--green-light);
    color: var(--green);
    border: 1px solid rgba(21, 128, 61, 0.15);
}

.auth-alert--error {
    background: var(--red-light);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.auth-alert--warning {
    background: var(--amber-light);
    color: var(--amber);
    border: 1px solid rgba(180, 83, 9, 0.15);
}

.auth-alert__text {
    flex: 1;
}


/* ========================
   Password rules checklist
   ======================== */

.auth-password-rules {
    list-style: none;
    margin: var(--space-md) 0 0;
    padding: 0;
}

.auth-password-rules__heading {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text);
    margin: var(--space-md) 0 var(--space-sm);
}

.auth-password-rules__heading:first-child {
    margin-top: 0;
}

.auth-password-rules__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    padding-left: var(--space-lg);
}

.auth-password-rules__item .rule-icon {
    display: inline-flex;
    flex-shrink: 0;
    color: var(--border);
    transition: color 0.15s;
}

.auth-password-rules__item--pass {
    color: var(--green);
}

.auth-password-rules__item--pass .rule-icon {
    color: var(--green);
}


/* ========================
   Radio buttons
   ======================== */

.auth-radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.auth-radio {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.auth-radio input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    outline: none;
    transition: border-color 0.15s;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
}

.auth-radio input[type="radio"]:checked {
    border-color: var(--navy);
}

.auth-radio input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    background: var(--navy);
    border-radius: 50%;
}

.auth-radio input[type="radio"]:focus {
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.auth-radio__label {
    font-size: var(--font-md);
    color: var(--text);
    font-weight: 500;
}

.auth-radio__detail {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-left: var(--space-xs);
}


/* ========================
   OTP / Verification code input
   ======================== */

.auth-otp-input {
    display: block;
    width: 180px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: var(--font-md);
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    outline: none;
    letter-spacing: 2px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-otp-input::placeholder {
    color: #cbd5e1;
    letter-spacing: normal;
}

.auth-otp-input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px var(--focus-ring);
}


/* ========================
   Note / warning box
   ======================== */

.auth-note {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-radius: var(--radius);
    background: var(--amber-light);
    border: 1px solid rgba(180, 83, 9, 0.15);
    font-size: var(--font-sm);
    color: #92400e;
    margin-top: var(--space-md);
}


/* ========================
   Confirm wrapper (username result)
   ======================== */

.auth-confirm {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: var(--space-md) var(--space-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.auth-confirm a {
    color: var(--navy);
    font-weight: 500;
    font-size: var(--font-md);
}


/* ========================
   Countdown timer
   ======================== */

.auth-countdown {
    font-size: var(--font-xl);
    font-weight: 600;
    color: var(--navy);
    text-align: center;
    margin: var(--space-lg) 0;
}

.auth-countdown--expired {
    color: var(--red);
}

.auth-expired-link {
    display: none;
    text-align: center;
    font-size: var(--font-body);
    color: var(--red);
    margin-bottom: var(--space-lg);
}

.auth-expired-link a {
    color: var(--red);
    text-decoration: underline;
}


/* ========================
   Inline helper text / links
   ======================== */

.auth-helper-text {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.auth-helper-text a {
    color: var(--navy);
    font-weight: 500;
}

.auth-helper-text a:hover {
    text-decoration: underline;
}


/* ========================
   Divider
   ======================== */

.auth-divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-lg) 0;
}


/* ========================
   Duplicate username error
   ======================== */

.auth-field__duplicate-error {
    display: none;
    font-size: var(--font-sm);
    color: var(--red);
    margin-top: var(--space-xs);
}


/* ========================
   Validation summary (server errors)
   ======================== */

.auth-validation-summary {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius);
    background: var(--red-light);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.15);
    font-size: var(--font-body);
    margin-top: var(--space-lg);
}

.auth-validation-summary ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.auth-validation-summary ul li {
    margin-bottom: var(--space-xs);
}

.auth-validation-summary ul li:last-child {
    margin-bottom: 0;
}


/* ========================
   Login card with branded header
   ======================== */

.auth-page--branded {
    background: var(--surface);
}

.auth-login {
    width: 100%;
    max-width: 28rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.08);
}

.auth-login__header {
    background: var(--navy);
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

/* Gradient accent at bottom of header */
.auth-login__header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green-dark), #7EB8E8);
}

.auth-login__logo {
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    filter: brightness(0) invert(1);
}

.auth-login__logo--ff {
    width: 16rem;
    height: 4.5rem;
    background-image: url('../images/formfire_abs.png');
}

.auth-login__logo--qp {
    width: 16rem;
    height: 4.5rem;
    background-image: url('../images/Quote-Plus-Green-Black.svg');
}

.auth-login__logo-divider {
    width: 1px;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.auth-login__body {
    background: var(--white);
    padding: 1.5rem 2rem 1.75rem;
}

.auth-login__title {
    font-size: var(--font-xl);
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin: 0 0 var(--space-lg);
}

.auth-login__submit {
    width: 100%;
    padding: 10px 24px;
    font-size: var(--font-md);
    margin-top: var(--space-sm);
}

.auth-login__forgot {
    text-align: center;
    margin-top: var(--space-md);
    margin-bottom: 0;
}


/* ========================
   Responsive
   ======================== */

@media only screen and (max-width: 480px) {
    .auth-page {
        padding: var(--space-lg);
        align-items: flex-start;
        padding-top: var(--space-xxl);
    }

    .auth-card {
        max-width: 100%;
        padding: var(--space-xl);
    }

    .auth-card--wide {
        max-width: 100%;
    }

    .auth-card__actions {
        flex-direction: column-reverse;
        gap: var(--space-sm);
    }

    .auth-card__actions--between {
        flex-direction: column-reverse;
    }

    .auth-btn {
        width: 100%;
    }

    .auth-login {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
    }

    .auth-login__header {
        padding: 2rem 1.5rem;
    }

    .auth-login__body {
        padding: 1.5rem;
    }
}
