/* ═══════════════════════════════════════════════════════════════
   Flowtavia Auth Flow — L1-L7 design system
   Source of truth: files-UI/flowtavia_designs/desktop/03_login_flow_L1-L7.html
                    files-UI/flowtavia_designs/mobile/01_mobile_login_dashboard_comms.html
   ═══════════════════════════════════════════════════════════════ */

/* ── Shell page background (the deep teal-blue around the device frame) ── */
body.auth-page {
    background: #C8D5E8;
    font-family: 'DM Sans', sans-serif;
    color: var(--gray-900);
    min-height: 100vh;
    padding: 32px 20px;
}

.auth-flow {
    max-width: 960px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════
   TABLET LANDSCAPE SHELL — desktop (960px wide split-pane)
   ═══════════════════════════════════════════════════════════════ */
.auth-tablet {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(13, 53, 133, .18);
    border: 1px solid rgba(255, 255, 255, .3);
    display: flex;
    background: var(--white);
    min-height: 560px;
}

@media (max-width: 880px) {
    .auth-tablet {
        flex-direction: column;
        min-height: 0;
    }
}

/* ── LEFT PANEL ── */
.auth-left {
    width: 420px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--blue-900) 0%, var(--blue-800) 40%, var(--blue-600) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px 44px 40px;
    color: var(--on-accent);
}

@media (max-width: 880px) {
    .auth-left { width: 100%; padding: 28px 24px; }
}

.auth-left::before {
    content: '';
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    border: 70px solid rgba(255, 255, 255, .04);
    top: -120px;
    right: -120px;
    pointer-events: none;
}

.auth-left::after {
    content: '';
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 45px solid rgba(255, 255, 255, .03);
    bottom: -80px;
    left: -80px;
    pointer-events: none;
}

.auth-left__gold-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--gold-300), var(--gold-400), var(--gold-200));
}

.auth-brand {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 30px;
    color: var(--on-accent);
    position: relative;
    z-index: 1;
    letter-spacing: .01em;
    line-height: 1;
}

.auth-brand span { color: var(--gold-300); }

.auth-brand__tagline {
    font-size: 13px;
    color: rgba(255, 255, 255, .5);
    margin-top: 5px;
    position: relative;
    z-index: 1;
}

.auth-illustration {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px 0;
}

.auth-illustration i { font-size: 96px; color: rgba(255, 255, 255, .1); }

.auth-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.auth-stat { display: flex; align-items: center; gap: 12px; }

.auth-stat__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-stat__icon i { font-size: 18px; color: var(--gold-300); }
.auth-stat__value { font-size: 16px; font-weight: 700; color: var(--on-accent); }
.auth-stat__label { font-size: 11px; color: rgba(255, 255, 255, .45); margin-top: 1px; }

/* ── RIGHT PANEL (form) ── */
.auth-right {
    flex: 1;
    background: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 52px;
}

.auth-right--centered { justify-content: center; }
.auth-right--centered .auth-right__inner { max-width: 380px; margin: 0 auto; width: 100%; }

@media (max-width: 880px) {
    .auth-right { padding: 32px 24px; }
}

.auth-eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold-500);
    margin-bottom: 5px;
}

.auth-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 26px;
    font-weight: 400;
    color: var(--blue-800);
    line-height: 1.2;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--gray-400);
    margin-bottom: 28px;
    line-height: 1.5;
}

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

/* ── Decorative circle around an icon (used in L4/L5/L6) ── */
.auth-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border: 2px solid;
}

.auth-icon-circle i { font-size: 30px; }
.auth-icon-circle--gold { background: var(--gold-100); border-color: var(--gold-200); }
.auth-icon-circle--gold i { color: var(--gold-500); }
.auth-icon-circle--blue { background: var(--blue-100); border-color: #A8C8F0; }
.auth-icon-circle--blue i { color: var(--blue-600); }
.auth-icon-circle--green { background: var(--green-100); border-color: var(--green-border); }
.auth-icon-circle--green i { color: var(--green-500); }

/* ═══════════════════════════════════════════════════════════════
   FORM FIELDS
   ═══════════════════════════════════════════════════════════════ */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.auth-field__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--gray-400);
}

.auth-field__input {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-100);
    border-radius: 14px;
    padding: 12px 14px;
    transition: all .15s;
}

.auth-field__input:focus-within {
    border-color: var(--blue-500);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(16, 66, 160, .08);
}

.auth-field__input > i {
    font-size: 17px;
    color: var(--blue-400);
    opacity: .7;
    flex-shrink: 0;
}

.auth-field__input input,
.auth-field__input select {
    background: none;
    border: none;
    outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: var(--gray-900);
    width: 100%;
}

.auth-field__input input::placeholder { color: var(--gray-300); }

.auth-field__input .auth-field__suffix {
    font-size: 12px;
    font-weight: 600;
    color: var(--blue-600);
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
}

.auth-field__input--disabled {
    opacity: .55;
    cursor: not-allowed;
}

.auth-field__toggle {
    cursor: pointer;
    color: var(--gray-300) !important;
    transition: color .15s;
}
.auth-field__toggle:hover { color: var(--blue-500) !important; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .15s;
    width: 100%;
}

.auth-btn i { font-size: 16px; }

.auth-btn--primary {
    background: var(--navy-800);
    color: var(--on-accent);
    box-shadow: 0 5px 18px rgba(13, 53, 133, .28);
}
.auth-btn--primary:hover:not(:disabled) {
    background: var(--navy-700);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(13, 53, 133, .32);
}
.auth-btn--primary i { color: var(--gold-300); }

.auth-btn--secondary {
    background: var(--white);
    color: var(--gray-600);
    border: 1.5px solid var(--gray-200);
}
.auth-btn--secondary:hover:not(:disabled) {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.auth-btn--gold {
    background: linear-gradient(135deg, var(--gold-400), var(--gold-300));
    color: var(--blue-900);
    box-shadow: 0 5px 18px rgba(240, 192, 64, .35);
}
.auth-btn--gold:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(240, 192, 64, .4);
}

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

.auth-btn__spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: auth-spin .7s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   TENANT CHIP
   ═══════════════════════════════════════════════════════════════ */
.auth-tenant-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--blue-50);
    border: 1.5px solid var(--blue-100);
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all .15s;
}

.auth-tenant-chip:hover {
    border-color: var(--blue-300);
    background: var(--blue-100);
}

.auth-tenant-chip--empty {
    border-color: var(--gold-200);
    background: #FFFDF5;
}

.auth-tenant-chip__icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--navy-800);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-tenant-chip__icon i { font-size: 17px; color: var(--gold-300); }

.auth-tenant-chip--empty .auth-tenant-chip__icon {
    background: var(--gray-200);
}
.auth-tenant-chip--empty .auth-tenant-chip__icon i { color: var(--gray-400); }

.auth-tenant-chip__info { flex: 1; }

.auth-tenant-chip__label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray-400);
}

.auth-tenant-chip__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-800);
    margin-top: 1px;
}

.auth-tenant-chip--empty .auth-tenant-chip__name {
    color: var(--gray-400);
    font-weight: 400;
}

.auth-tenant-chip__change {
    font-size: 12px;
    font-weight: 600;
    color: var(--blue-600);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.auth-tenant-chip--empty .auth-tenant-chip__change { color: var(--gold-600); }

/* ═══════════════════════════════════════════════════════════════
   TENANT LIST (L1)
   ═══════════════════════════════════════════════════════════════ */
.auth-tenant-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.auth-tenant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 14px;
    cursor: pointer;
    transition: all .15s;
    background: var(--white);
}

.auth-tenant-item:hover { border-color: var(--blue-400); background: var(--blue-50); }
.auth-tenant-item--selected { border-color: var(--blue-700); background: var(--blue-50); }

.auth-tenant-item__logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.auth-tenant-item__info { flex: 1; }

.auth-tenant-item__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

.auth-tenant-item--selected .auth-tenant-item__name { color: var(--blue-800); }

.auth-tenant-item__sub {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
}

.auth-tenant-item__check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-tenant-item--selected .auth-tenant-item__check {
    background: var(--navy-700);
    border-color: var(--blue-700);
}

.auth-tenant-item--selected .auth-tenant-item__check i {
    font-size: 12px;
    color: var(--on-accent);
}

/* ═══════════════════════════════════════════════════════════════
   ROW HELPERS
   ═══════════════════════════════════════════════════════════════ */
.auth-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-500);
    cursor: pointer;
}

.auth-remember input {
    accent-color: var(--blue-700);
    width: 15px;
    height: 15px;
}

.auth-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-600);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.auth-link:hover { color: var(--blue-800); }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-100);
}

.auth-divider span {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.auth-footer {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: var(--gray-400);
}

.auth-footer a {
    color: var(--blue-600);
    font-weight: 600;
    text-decoration: none;
}
.auth-footer a:hover { color: var(--blue-800); }

.auth-footer--powered {
    margin-top: 8px;
    font-size: 11px;
    color: var(--gray-300);
}
.auth-footer--powered strong { color: var(--blue-700); }

.auth-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-100);
    border-radius: 14px;
    padding: 11px 14px;
    margin-bottom: 14px;
}
.auth-search i { font-size: 17px; color: var(--gray-300); }
.auth-search input {
    background: none; border: none; outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px; color: var(--gray-900); width: 100%;
}
.auth-search input::placeholder { color: var(--gray-300); }

/* ═══════════════════════════════════════════════════════════════
   ROLE CARDS (L3)
   ═══════════════════════════════════════════════════════════════ */
.auth-role-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

@media (max-width: 560px) { .auth-role-grid { grid-template-columns: 1fr; } }

.auth-role-card {
    border: 2px solid var(--gray-200);
    border-radius: 18px;
    padding: 24px 20px;
    cursor: pointer;
    text-align: center;
    transition: all .2s;
    position: relative;
    overflow: hidden;
    background: var(--white);
}

.auth-role-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gray-200);
    transition: background .2s;
}

.auth-role-card:hover { border-color: var(--blue-300); background: var(--blue-50); }
.auth-role-card:hover::before { background: var(--blue-400); }

.auth-role-card--selected { border-color: var(--blue-700); }
.auth-role-card--selected::before { background: var(--gold-300); }

.auth-role-card__icon {
    width: 56px; height: 56px;
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
}

.auth-role-card__icon i { font-size: 28px; }

.auth-role-card--lawyer .auth-role-card__icon { background: var(--blue-100); }
.auth-role-card--lawyer .auth-role-card__icon i { color: var(--blue-700); }
.auth-role-card--client .auth-role-card__icon { background: var(--gold-100); }
.auth-role-card--client .auth-role-card__icon i { color: var(--gold-600); }

.auth-role-card--selected .auth-role-card__icon {
    background: var(--navy-800);
}
.auth-role-card--selected .auth-role-card__icon i { color: var(--gold-300); }

.auth-role-card__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 5px;
}

.auth-role-card--selected .auth-role-card__name { color: var(--blue-800); }

.auth-role-card__desc {
    font-size: 12px;
    color: var(--gray-400);
    line-height: 1.5;
}

.auth-role-perks {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-role-perk {
    font-size: 11px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.auth-role-perk i { font-size: 12px; color: var(--green-500); }

/* ═══════════════════════════════════════════════════════════════
   PASSWORD STRENGTH (L6)
   ═══════════════════════════════════════════════════════════════ */
.auth-pwd-strength {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.auth-pwd-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--gray-100);
}

.auth-pwd-bar--weak { background: var(--red-500); }
.auth-pwd-bar--ok { background: var(--gold-300); }
.auth-pwd-bar--strong { background: var(--green-500); }

.auth-pwd-text {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
}

.auth-pwd-text strong--weak { color: var(--red-500); }
.auth-pwd-text strong--ok { color: var(--gold-500); }
.auth-pwd-text strong--strong { color: var(--green-500); }

/* ═══════════════════════════════════════════════════════════════
   OTP BOXES (L5)
   ═══════════════════════════════════════════════════════════════ */
.auth-otp-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-otp-box {
    width: 52px;
    height: 60px;
    border: 2px solid var(--gray-200);
    border-radius: 14px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--blue-800);
    font-family: 'DM Sans', sans-serif;
    outline: none;
    background: var(--gray-50);
    transition: all .15s;
}

.auth-otp-box:focus {
    border-color: var(--blue-500);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(16, 66, 160, .08);
}

.auth-otp-box--filled {
    border-color: var(--blue-300);
    background: var(--blue-50);
}

@media (max-width: 560px) {
    .auth-otp-box { width: 42px; height: 50px; font-size: 20px; }
    .auth-otp-row { gap: 6px; }
}

/* ═══════════════════════════════════════════════════════════════
   ALERTS / WARNINGS (L7)
   ═══════════════════════════════════════════════════════════════ */
.auth-alert {
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    line-height: 1.5;
}

.auth-alert > i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.auth-alert--gold {
    background: #FFFDF5;
    border: 1.5px solid var(--gold-200);
    color: var(--gold-700);
}
.auth-alert--gold > i { color: var(--gold-600); }
.auth-alert--gold strong { color: var(--gold-700); }

.auth-alert--red {
    background: var(--red-100);
    border: 1.5px solid var(--red-border);
    color: var(--red-600);
}
.auth-alert--red > i { color: var(--red-500); }

.auth-alert--green {
    background: var(--green-100);
    border: 1.5px solid var(--green-border);
    color: var(--green-600);
}
.auth-alert--green > i { color: var(--green-500); }

/* ═══════════════════════════════════════════════════════════════
   MOBILE — phone shell (375px iPhone format)
   Used by Flowtavia.Client portal at sub-880px
   ═══════════════════════════════════════════════════════════════ */
.auth-phone {
    max-width: 375px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 40px;
    overflow: hidden;
    box-shadow:
        0 24px 64px rgba(13, 53, 133, .25),
        0 0 0 8px rgba(255, 255, 255, .12),
        0 0 0 9px rgba(13, 53, 133, .12);
    display: flex;
    flex-direction: column;
    min-height: 720px;
    position: relative;
}

/* On real phones, drop the bezel chrome and fill screen */
@media (max-width: 420px) {
    body.auth-page { padding: 0; background: var(--white); }
    .auth-phone {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
    }
}

.auth-phone__status {
    background: var(--navy-800);
    padding: 12px 24px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--on-accent);
    font-size: 13px;
    font-weight: 700;
}

.auth-phone__status-icons { display: flex; gap: 4px; align-items: center; }
.auth-phone__status-icons i { font-size: 14px; color: rgba(255,255,255,.9); }

.auth-phone__header {
    background: var(--white);
    border-bottom: 3px solid var(--gold-300);
    padding: 11px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-phone__logo {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 16px;
    color: var(--blue-800);
    flex: 1;
}
.auth-phone__logo span { color: var(--gold-300); }

.auth-phone__body {
    overflow-y: auto;
    flex: 1;
    background: var(--gray-50);
    padding: 20px 16px 24px;
}

.auth-phone__title-bar {
    background: var(--white);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--gray-100);
}

.auth-phone__back {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
}
.auth-phone__back i { font-size: 16px; color: var(--gray-500); }

.auth-phone__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue-800);
    flex: 1;
}

/* mobile eyebrow/title/subtitle reduced */
.auth-phone .auth-title { font-size: 22px; }
.auth-phone .auth-eyebrow { color: var(--gold-600); }
