/* ============================================================================
   Stimes Identity Server — login pages CSS
   Mirrors /angular/src/assets/auth-redesign-mockup.html design language.
   Single design system, no legacy artefacts.
   ============================================================================ */

:root {
    --brand-50:  #f5f0fb;
    --brand-100: #ebddf7;
    --brand-200: #d2b5f0;
    --brand-400: #8b5cf6;
    --brand-500: #a855f7;
    --brand-600: #6d28d9;
    --brand-700: #4c1d95;
    --brand-800: #1f0e3d;

    --bg:           #f5f3f9;
    --surface:      #ffffff;
    --surface-alt:  #faf8fc;
    --border:       #e7e2ee;
    --divider:      #efebf5;

    --text:           #1f0e3d;
    --text-secondary: #4b5563;
    --text-muted:     #6b7280;
    --text-disabled:  #9ca3af;
    --on-brand:       #ffffff;

    --error:   #b91c1c;
    --success: #15803d;
    --warning: #b45309;

    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
    --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;

    --r-1: 4px; --r-2: 6px; --r-3: 10px; --r-pill: 9999px;

    --sh-1: 0 1px 2px rgba(31,14,61,0.06);
    --sh-2: 0 4px 12px rgba(31,14,61,0.08);
    --sh-3: 0 16px 40px rgba(31,14,61,0.18);

    --d-fast: 120ms;
    --d-default: 220ms;
    --ease-out: cubic-bezier(0.2, 0, 0, 1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    height: 100%;
}

body {
    font-family: 'Roboto', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: transparent; }

/* ============================================================================
   Auth shell — two-column grid: aside (left) + form (right)
   ============================================================================ */
.auth {
    height: 100vh; max-height: 100vh;
    display: grid;
    grid-template-columns: 1fr clamp(480px, 36vw, 880px);
    background: var(--bg);
    overflow: hidden;
}
@media (max-width: 960px) {
    .auth {
        grid-template-columns: 1fr;
        height: auto; max-height: none; overflow: visible;
    }
    .auth__aside { display: none; }
}

/* ============================================================================
   Aside (dark brand panel — left)
   ============================================================================ */
.auth__aside {
    position: relative;
    background:
        radial-gradient(800px 500px at 12% 18%, rgba(168,85,247,0.32) 0%, transparent 55%),
        radial-gradient(700px 600px at 88% 30%, rgba(124,58,237,0.28) 0%, transparent 60%),
        radial-gradient(900px 500px at 50% 100%, rgba(76,29,149,0.55) 0%, transparent 65%),
        linear-gradient(155deg, #160a30 0%, #1f0e3d 45%, #2c1761 100%);
    color: #fff;
    padding: var(--s-6) var(--s-7);
    overflow: hidden;
    display: flex; flex-direction: column;
    min-height: 0;
    contain: layout paint;
}
.auth__aside::before {
    content: ""; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-mask-image: radial-gradient(circle at 30% 60%, #000 0%, #000 55%, transparent 100%);
    mask-image: radial-gradient(circle at 30% 60%, #000 0%, #000 55%, transparent 100%);
    pointer-events: none;
}
.auth__aside::after {
    content: ""; position: absolute;
    width: 360px; height: 360px;
    background: radial-gradient(circle, rgba(168,85,247,0.32) 0%, transparent 65%);
    border-radius: 50%;
    top: 35%; left: -120px;
    filter: blur(40px);
    pointer-events: none;
}

/* Brand block at top of aside */
.auth__brand {
    display: flex; align-items: center; gap: 12px;
    position: relative; z-index: 1;
}
.auth__brand-mark {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 19px; color: #fff;
    position: relative;
    box-shadow: 0 8px 24px rgba(76,29,149,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.auth__brand-mark::after {
    content: ""; position: absolute;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--brand-500);
    top: -3px; right: -3px;
    box-shadow: 0 0 0 3px var(--brand-800), 0 0 12px var(--brand-400);
}
.auth__brand-words { display: flex; flex-direction: column; line-height: 1.1; }
.auth__brand-product { font-size: 17px; font-weight: 600; letter-spacing: -0.005em; }
.auth__brand-tenant { font-size: 12px; color: rgba(255,255,255,0.7); }

/* Carousel inside aside */
.auth__carousel {
    margin: var(--s-4) 0 var(--s-3);
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.auth__carousel .slide {
    position: absolute; inset: 0;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: var(--s-2);
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
    pointer-events: none;
}
.auth__carousel .slide.is-active {
    opacity: 1; transform: translateY(0);
    pointer-events: auto;
}
.slide__eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px;
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    padding: 5px 12px 5px 8px;
    border-radius: var(--r-pill);
    align-self: flex-start;
    margin-bottom: var(--s-2);
    text-transform: uppercase; letter-spacing: 0.06em;
    font-weight: 600;
}
.slide__eyebrow .pi {
    background: var(--brand-500);
    color: #fff;
    width: 18px; height: 18px;
    font-size: 10px;
    box-shadow: 0 0 0 3px rgba(168,85,247,0.2);
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
}
.auth__carousel .slide h1 {
    font-size: 26px; line-height: 1.2; font-weight: 700;
    letter-spacing: -0.015em;
    color: #fff; margin: 0;
    max-width: 540px;
}
.auth__carousel .slide p {
    font-size: 13px; line-height: 1.55;
    color: rgba(255,255,255,0.75);
    margin: 0; max-width: 520px;
}

/* Preview cards */
.preview {
    margin-top: var(--s-2);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: var(--s-3);
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 32px rgba(8,4,20,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
    max-width: 540px;
    min-height: 0;
    overflow: hidden;
    contain: layout paint;
}
.preview__top { display: flex; gap: 6px; margin-bottom: var(--s-3); }
.preview__top span {
    width: 9px; height: 9px; border-radius: 50%;
    background: rgba(255,255,255,0.18);
}
.preview__top span:first-child { background: rgba(248,113,113,0.55); }
.preview__top span:nth-child(2) { background: rgba(250,204,21,0.55); }
.preview__top span:nth-child(3) { background: rgba(74,222,128,0.55); }

.preview--chat .chat-row {
    display: flex; gap: 10px; align-items: flex-start; padding: 6px 0;
}
.preview--chat .chat-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 600;
    background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
    color: #fff;
}
.preview--chat .chat-avatar--ai {
    background: linear-gradient(135deg, #1f0e3d, #4c1d95);
    position: relative;
    border: 1px solid rgba(168,85,247,0.4);
}
.preview--chat .chat-avatar--ai::after {
    content: ""; position: absolute;
    width: 6px; height: 6px; border-radius: 50%;
    top: -2px; right: -2px;
    background: var(--brand-500);
    box-shadow: 0 0 8px var(--brand-400);
    animation: lp-aiPulse 1.8s ease-in-out infinite;
}
@keyframes lp-aiPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(1.2); }
}
.preview--chat .chat-bubble { flex: 1; min-width: 0; }
.preview--chat .chat-name {
    font-size: 11px; font-weight: 600; color: #fff;
    display: flex; gap: 8px; align-items: center;
    margin-bottom: 3px;
}
.preview--chat .chat-time { font-size: 10px; color: rgba(255,255,255,0.5); font-weight: 400; }
.preview--chat .chat-msg {
    font-size: 12px; line-height: 1.5;
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.06);
    border-radius: 8px 8px 8px 2px;
    padding: 7px 10px;
    display: inline-block;
}
.preview--chat .chat-msg--ai {
    background: linear-gradient(135deg, rgba(168,85,247,0.18), rgba(76,29,149,0.18));
    border: 1px solid rgba(168,85,247,0.35);
    color: #fff;
}
.preview--chat .ai-tag {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 9px; font-weight: 600;
    padding: 1px 5px;
    background: rgba(168,85,247,0.2);
    border: 1px solid rgba(168,85,247,0.35);
    color: #d2b5f0;
    border-radius: 4px;
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-left: 4px;
}
.preview--chat .chat-meeting {
    display: flex; gap: 8px; align-items: center;
    padding: 8px 10px; margin-top: 6px;
    background: rgba(74,222,128,0.1);
    border: 1px solid rgba(74,222,128,0.25);
    border-radius: 8px;
    font-size: 11px; color: #bbf7d0;
}
.preview--chat .chat-meeting .pi { color: #4ade80; }
.preview--chat .live-dot,
.preview--agents .live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #4ade80;
    animation: lp-pulseDot 1.4s ease-in-out infinite;
    margin-left: auto;
}
@keyframes lp-pulseDot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

.preview--insight .ai-prompt {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 10px;
}
.preview--insight .ai-prompt .pi { color: var(--brand-400); font-size: 13px; }
.preview--insight .ai-prompt .caret {
    width: 1px; height: 14px;
    background: var(--brand-400);
    margin-left: 2px;
    animation: lp-caretBlink 1.1s steps(2,start) infinite;
}
@keyframes lp-caretBlink { 50% { opacity: 0; } }
.preview--insight .ai-answer {
    padding: 12px;
    background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(76,29,149,0.12));
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 10px;
}
.preview--insight .ai-answer__hd {
    display: flex; align-items: center; gap: 6px;
    font-size: 10.5px; font-weight: 600;
    color: #d2b5f0;
    margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.preview--insight .ai-mark,
.preview--agents .ai-mark {
    width: 14px; height: 14px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 8px; color: #fff; font-weight: 700;
    box-shadow: 0 0 0 2px rgba(168,85,247,0.2);
}
.preview--insight .ai-answer__body { font-size: 12px; line-height: 1.55; color: #fff; }
.preview--insight .ai-answer__body em {
    background: rgba(168,85,247,0.2);
    padding: 0 4px; border-radius: 3px;
    color: #fff; font-style: normal; font-weight: 600;
}

.preview--agents .agents-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.preview--agents .agent {
    padding: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    display: flex; gap: 9px; align-items: flex-start;
    position: relative;
}
.preview--agents .agent__icon {
    width: 28px; height: 28px;
    border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    position: relative;
}
.preview--agents .agent__icon::after {
    content: ""; position: absolute;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--brand-500);
    top: -2px; right: -2px;
    box-shadow: 0 0 0 2px #1f0e3d;
}
.preview--agents .agent__body { min-width: 0; flex: 1; }
.preview--agents .agent__name { font-size: 11px; font-weight: 600; color: #fff; }
.preview--agents .agent__status {
    font-size: 9.5px; color: rgba(255,255,255,0.6);
    margin-top: 2px;
    display: flex; align-items: center; gap: 4px;
}
.preview--agents .agent__status .live-dot { width: 5px; height: 5px; margin-left: 0; }
.preview--agents .agents-foot {
    margin-top: var(--s-3);
    padding: 8px 10px;
    background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(76,29,149,0.12));
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 8px;
    font-size: 10.5px; color: #d2b5f0;
    display: flex; align-items: center; gap: 6px;
}

/* Carousel dots */
.carousel-dots {
    display: flex; gap: 8px;
    margin: var(--s-3) 0 var(--s-2);
    position: relative; z-index: 1;
}
.carousel-dots .indicator {
    width: 36px; height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.18);
    cursor: pointer; padding: 0;
    transition: width var(--d-default) var(--ease-out), background var(--d-fast) var(--ease-out);
    border: 0;
}
.carousel-dots .indicator:hover { background: rgba(255,255,255,0.32); }
.carousel-dots .indicator.is-active {
    width: 96px;
    background: linear-gradient(90deg, var(--brand-400), var(--brand-200));
    box-shadow: 0 0 12px rgba(168,85,247,0.5);
}

/* AI capabilities panel */
.ai-caps {
    position: relative; z-index: 1;
    max-width: 580px;
    margin: var(--s-2) 0;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(168,85,247,0.22);
    border-radius: var(--r-3);
    backdrop-filter: blur(8px);
    display: flex; flex-direction: column; gap: 6px;
}
.ai-caps__row {
    display: grid; grid-template-columns: 92px 1fr; gap: 10px;
    align-items: center;
    font-size: 11px; line-height: 1.4;
    min-width: 0;
}
.ai-caps__lbl {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 10px; font-weight: 700;
    color: var(--brand-200);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.ai-caps__lbl .pi { font-size: 10px; color: var(--brand-400); }
.ai-caps__mark {
    width: 18px; height: 18px;
    background: var(--brand-800); color: #fff;
    border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700;
    position: relative; flex-shrink: 0;
}
.ai-caps__mark::after {
    content: ""; position: absolute;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--brand-500);
    top: -1px; right: -1px;
    box-shadow: 0 0 0 1.5px rgba(31,14,61,0.85), 0 0 6px var(--brand-400);
}
.ai-caps__list {
    color: rgba(255,255,255,0.78);
    display: flex; flex-wrap: wrap; gap: 3px 8px;
    min-width: 0; overflow: hidden;
    font-size: 11px;
}
.ai-caps__list span { white-space: nowrap; }
.ai-caps__list span::after { content: " ·"; color: rgba(255,255,255,0.3); margin-left: 4px; }
.ai-caps__list span:last-child::after { content: ""; }
.ai-caps__list strong { color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Country flags */
.auth__flags {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: var(--s-3) 0 var(--s-2);
    position: relative; z-index: 1;
}
.auth__flag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--r-pill);
    font-size: 11px; font-weight: 500;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
}
.auth__flag:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
}
.auth__flag .flag-img {
    height: 14px; width: 21px;
    flex-shrink: 0;
    display: inline-block;
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.18);
    object-fit: cover;
    vertical-align: middle;
}

/* Footer */
.auth__foot {
    position: relative; z-index: 1;
    font-size: 11px; color: rgba(255,255,255,0.5);
    display: flex; justify-content: space-between; align-items: center;
    gap: var(--s-3); flex-wrap: wrap;
}
.auth__foot a { color: rgba(255,255,255,0.7); }
.auth__foot a:hover { color: #fff; text-decoration: underline; }

/* ============================================================================
   Main column (form panel — right)
   ============================================================================ */
.auth__main {
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, #fdfcff 0%, #f7f4fc 100%);
    position: relative;
    min-height: 0;
    overflow: hidden;
}
.auth__topbar {
    height: 56px;
    display: flex; align-items: center; gap: var(--s-2);
    padding: 0 var(--s-6);
    border-bottom: 1px solid transparent;
    position: relative;
}
.auth__topbar > .ai-btn { margin-left: auto; }
.auth__topbar > .auth__lang:not(.ai-btn ~ *) { margin-left: auto; }
.auth__topbar > .ai-btn ~ .auth__lang { margin-left: 0; }

/* "Ask Stimes AI" pill (matches the shell-redesign mark with brand-500 i-dot) */
.ai-btn {
    height: 36px; padding: 0 12px 0 6px;
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--surface);
    color: var(--brand-700);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    font-weight: 600; font-size: 12.5px;
    position: relative;
    box-shadow: var(--sh-1);
}
.ai-btn:hover { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }
.ai-btn .sparkle {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-800);
    color: #fff;
    font-size: 13px; font-weight: 700;
    border-radius: var(--r-1);
    box-shadow: 0 2px 6px rgba(31,14,61,0.30);
    flex-shrink: 0;
    position: relative;
}
.ai-btn .sparkle::after {
    content: ""; position: absolute;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--brand-500);
    top: -2px; right: -2px;
    box-shadow: 0 0 0 2px var(--surface);
    animation: lp-aiBtnPulse 2.4s ease-in-out infinite;
}
@keyframes lp-aiBtnPulse {
    0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 0 rgba(168,85,247,0)); }
    50%      { transform: scale(1.18); filter: drop-shadow(0 0 4px rgba(168,85,247,0.55)); }
}
.ai-btn__kbd {
    font-size: 10px; font-weight: 600;
    padding: 2px 6px; border-radius: var(--r-1);
    background: var(--brand-50); color: var(--brand-700);
    border: 1px solid var(--brand-100);
    margin-left: 2px;
}

/* Ask Stimes AI popover */
.ai-popover {
    position: absolute; top: 56px; right: var(--s-6);
    width: 360px; max-width: calc(100vw - 32px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-3);
    box-shadow: var(--sh-3);
    z-index: 50;
    overflow: hidden;
    display: none;
    animation: lp-aiPopIn 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ai-popover.is-open { display: block; }
@keyframes lp-aiPopIn {
    0%   { opacity: 0; transform: translateY(-8px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.ai-popover__head {
    display: flex; align-items: center; gap: 10px;
    padding: var(--s-3) var(--s-4);
    background: linear-gradient(135deg, var(--brand-800) 0%, var(--brand-700) 100%);
    color: #fff;
}
.ai-popover__mark {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--r-2);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff;
    position: relative; flex-shrink: 0;
}
.ai-popover__mark::after {
    content: ""; position: absolute;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--brand-500);
    top: -2px; right: -2px;
    box-shadow: 0 0 0 2px var(--brand-800), 0 0 10px var(--brand-400);
    animation: lp-aiBtnPulse 2.4s ease-in-out infinite;
}
.ai-popover__title { flex: 1; font-size: 13px; font-weight: 600; line-height: 1.2; }
.ai-popover__title small { display: block; font-size: 10.5px; font-weight: 400; color: rgba(255,255,255,0.7); margin-top: 2px; }
.ai-popover__close {
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-2);
    color: rgba(255,255,255,0.8);
    background: transparent; border: 0; cursor: pointer;
}
.ai-popover__close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.ai-popover__body { padding: var(--s-3) var(--s-4) var(--s-4); max-height: 60vh; overflow-y: auto; }
.ai-popover__greet {
    display: flex; gap: 10px; padding: 10px 12px;
    background: var(--brand-50);
    border: 1px solid var(--brand-100);
    border-radius: var(--r-3);
    font-size: 12.5px; line-height: 1.5;
    color: var(--brand-800);
    margin-bottom: var(--s-3);
}
.ai-popover__greet .pi { color: var(--brand-600); flex-shrink: 0; margin-top: 2px; }
.ai-popover__sect-h {
    font-size: 10.5px; font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin: var(--s-3) 0 var(--s-2);
}
.ai-prompts { display: flex; flex-direction: column; gap: 6px; }
.ai-prompt-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--r-2);
    text-align: left; width: 100%;
    font-size: 12.5px; color: var(--text); line-height: 1.4;
    cursor: pointer;
}
.ai-prompt-btn:hover { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-800); }
.ai-prompt-btn .pi {
    color: var(--brand-600);
    font-size: 13px;
    flex-shrink: 0;
}
.ai-popover__composer {
    display: flex; gap: 6px; align-items: center;
    padding: var(--s-3);
    border-top: 1px solid var(--divider);
    background: var(--surface-alt);
}
.ai-popover__composer input {
    flex: 1; height: 36px;
    background: var(--surface);
    font-size: 12.5px;
    border-radius: var(--r-2);
    border: 1px solid var(--border);
    padding: 0 12px;
}
.ai-popover__composer input:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px var(--brand-100);
}
.ai-popover__composer button {
    width: 36px; height: 36px;
    background: var(--brand-600); color: #fff;
    border-radius: var(--r-2);
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; cursor: pointer;
}
.ai-popover__composer button:hover { background: var(--brand-700); }
.auth__topbar-mobile-brand {
    display: none; align-items: center; gap: 10px;
    font-weight: 600; color: var(--brand-800);
}
.auth__topbar-mobile-brand .brand-dot {
    width: 28px; height: 28px;
    background: var(--brand-800);
    color: #fff; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; position: relative;
}
.auth__topbar-mobile-brand .brand-dot::after {
    content: ""; position: absolute;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--brand-500); top: -2px; right: -2px;
    box-shadow: 0 0 0 2px var(--surface);
}
@media (max-width: 960px) {
    .auth__topbar-mobile-brand { display: inline-flex; }
}
.auth__lang {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    font-size: 12px; color: var(--text-secondary);
    background: var(--surface);
    box-shadow: var(--sh-1);
}
.auth__lang:hover { border-color: var(--brand-200); color: var(--brand-700); }

.auth__body {
    flex: 1;
    /* Card sits below the topbar with comfortable breathing room — still
       top-biased so it doesn't drift toward dead-center on tall viewports,
       but enough vertical padding that the brand mark + title don't hug the
       topbar. Horizontal centering is unchanged. */
    display: flex; align-items: flex-start; justify-content: center;
    padding: clamp(60px, 10vh, 140px) var(--s-6) var(--s-4);
    overflow-y: auto;
    scrollbar-gutter: stable;
    contain: layout paint;
}
.auth__card {
    width: 100%; max-width: clamp(380px, 26vw, 480px);
    display: flex; flex-direction: column;
    /* margin-top driven by .auth__body's padding-top; bottom auto keeps
       short content from hugging the topbar on tall viewports. */
    margin: 0 0 auto;
}
.auth__card--centered { text-align: center; align-items: center; }
.auth__card--centered .auth__title,
.auth__card--centered .auth__subtitle,
.auth__card--centered form,
.auth__card--centered .btn { width: 100%; }
.auth__card--centered .auth__subtitle { text-align: center; }

/* Client logo block: centered horizontally, sits at the top of the auth card.
   The wrapper itself centers its children via flex alignment, AND keeps any
   text/element rendered inside the OrganizationLogo view component centred. */
.client-logo {
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
    margin: 0 auto var(--s-3);
}
.client-logo img {
    max-width: 140px; max-height: 48px;
    width: auto; height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Splash logo (for centered cards) */
.splash-logo {
    max-width: 150px; max-height: 56px;
    width: auto; height: auto;
    object-fit: contain;
    margin: 0 auto var(--s-3);
    display: block;
}

/* Lock-icon header (used on confirmation / locked states) */
.lock-icon {
    width: 48px; height: 48px;
    background: #fef2f2; color: var(--error);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    margin: 0 auto var(--s-3);
}
.lock-icon .pi { font-size: 26px; }
.lock-icon--ok { background: #f0fdf4; color: var(--success); }

/* Headings */
.auth__title {
    font-size: 22px; font-weight: 700; line-height: 1.2;
    color: var(--brand-800);
    letter-spacing: -0.015em;
    margin: 0 0 var(--s-1);
}
.auth__subtitle {
    font-size: 13.5px; color: var(--text-secondary);
    margin: 0 0 var(--s-4);
    line-height: 1.45;
}
.auth__subtitle strong { color: var(--text); font-weight: 600; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600;
    color: var(--brand-600);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin: 0 0 var(--s-2);
}

/* ============================================================================
   Form fields
   ============================================================================ */
.field { margin-bottom: var(--s-3); }
.field__label {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12.5px; font-weight: 600; color: var(--text);
    margin-bottom: 8px;
}
.field__label .login-forgot-link,
.field__label .help-link {
    font-size: 12px; font-weight: 500;
    color: var(--brand-600);
    text-decoration: none;
}
.field__label .login-forgot-link:hover,
.field__label .help-link:hover { color: var(--brand-700); text-decoration: underline; }
.field__hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.input-wrap { position: relative; }
.input-wrap input,
.input-wrap input.form-control,
input.form-control {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid #e2dcec;
    border-radius: var(--r-3);
    box-shadow: 0 1px 2px rgba(31,14,61,0.03);
    transition: border-color var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
    outline: none;
}
.input-wrap input:hover,
input.form-control:hover { border-color: var(--brand-200); }
.input-wrap input:focus,
input.form-control:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px var(--brand-100), 0 1px 2px rgba(31,14,61,0.04);
}
.input-wrap input::placeholder,
input.form-control::placeholder { color: var(--text-disabled); }

.input-wrap.has-prefix input,
.input-wrap.has-prefix input.form-control { padding-left: 40px; }
.input-wrap .input-prefix {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.input-wrap .input-icon {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    border-radius: var(--r-2);
    background: transparent; border: 0;
}
.input-wrap .input-icon:hover { color: var(--brand-600); background: var(--brand-50); }

/* Validation messages */
.text-danger,
.field-validation-error,
span[asp-validation-for] {
    color: var(--error);
    font-size: 12px;
    line-height: 1.4;
    display: block;
    margin-top: 6px;
}
.text-danger:empty { display: none; }

div.text-danger,
div[asp-validation-summary],
.validation-summary-errors {
    color: var(--error);
    font-size: 12.5px;
    margin: 0 0 var(--s-4);
}
div.text-danger:not(:empty),
div[asp-validation-summary]:not(:empty),
.validation-summary-errors:not(:empty) {
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--r-3);
}
.validation-summary-errors ul { list-style: none; margin: 0; padding: 0; }
.validation-summary-errors ul li { padding: 2px 0; }

/* Remember me / checkbox row */
.checkbox-row {
    display: flex; align-items: center; justify-content: space-between;
    margin: 0 0 var(--s-4);
    flex-wrap: wrap; gap: var(--s-2);
}
.cbx {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-secondary);
    cursor: pointer; user-select: none;
}
.cbx input[type="checkbox"],
.cbx .form-check-input {
    width: 16px; height: 16px; margin: 0; padding: 0;
    accent-color: var(--brand-600);
}

/* Stacked label + checkbox (Trust this device for 30 days etc.) — left-aligned,
   description on its own line so multi-line hints don't push to the far side. */
.checkbox-stack {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 0 0 var(--s-3);
    padding: 8px 12px;
    background: var(--surface-alt, #faf8fc);
    border: 1px solid var(--border, #e7e2ee);
    border-radius: var(--r-2, 6px);
    cursor: pointer;
    transition: border-color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.checkbox-stack:hover {
    border-color: var(--brand-200);
    background: var(--brand-50);
}
.checkbox-stack > input[type="checkbox"] {
    width: 16px; height: 16px;
    margin: 2px 0 0 0; padding: 0;
    accent-color: var(--brand-600);
    flex-shrink: 0;
}
.checkbox-stack > span {
    display: flex; flex-direction: column;
    gap: 3px;
    font-size: 13px; color: var(--text);
    line-height: 1.4;
    min-width: 0;
}
.checkbox-stack strong { font-weight: 600; color: var(--text); }
.checkbox-stack .field__hint {
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.45;
}

/* Resend confirmation row */
.resend-confirm {
    margin: -8px 0 var(--s-3);
    font-size: 13px;
}

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px;
    padding: 0 16px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: var(--r-2);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--d-fast) var(--ease-out),
                border-color var(--d-fast) var(--ease-out),
                color var(--d-fast) var(--ease-out),
                box-shadow var(--d-default) var(--ease-out),
                transform var(--d-fast) var(--ease-out);
}
.btn:hover { background: var(--surface-alt); border-color: var(--brand-200); color: var(--brand-700); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--lg { height: 42px; font-size: 13.5px; border-radius: var(--r-3); }
.btn--block, .btn.w-100 { width: 100%; }
.btn--primary,
.login-submit-button,
.btn-primary {
    background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
    border-color: var(--brand-700);
    color: var(--on-brand);
    box-shadow: 0 8px 20px rgba(109,40,217,0.32), inset 0 1px 0 rgba(255,255,255,0.12);
    letter-spacing: 0.005em;
}
.btn--primary:hover,
.login-submit-button:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-800) 100%);
    border-color: var(--brand-800);
    color: var(--on-brand);
    box-shadow: 0 12px 28px rgba(76,29,149,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
    transform: translateY(-1px);
}
.btn--primary:active,
.login-submit-button:active,
.btn-primary:active { transform: translateY(0); }
.btn--primary .pi { font-size: 13px; transition: transform var(--d-fast); }
.btn--primary:hover .pi { transform: translateX(2px); }
.btn-link {
    background: transparent; border: 0;
    color: var(--brand-600);
    font-weight: 500;
    padding: 0; height: auto;
    text-decoration: underline;
}
.btn-link:hover { color: var(--brand-700); }

.auth__footnote {
    text-align: center;
    font-size: 12px; color: var(--text-muted);
    margin: var(--s-5) 0 0;
}
.auth__footnote a { font-weight: 500; }

/* Feature tiles — fills the right pane on big screens (24"+). */
.feature-tiles {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-3);
    margin-top: var(--s-7);
    padding-top: var(--s-5);
    border-top: 1px solid var(--divider);
}
.feature-tile {
    text-align: left;
    padding: var(--s-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-3);
    box-shadow: var(--sh-1);
    display: flex; flex-direction: column; gap: 6px;
    transition: border-color var(--d-fast) var(--ease-out),
                transform var(--d-fast) var(--ease-out),
                box-shadow var(--d-default) var(--ease-out);
    text-decoration: none;
    color: inherit;
}
.feature-tile:hover {
    border-color: var(--brand-200);
    transform: translateY(-1px);
    box-shadow: var(--sh-2);
    text-decoration: none;
}
.feature-tile__icon {
    width: 32px; height: 32px;
    border-radius: var(--r-2);
    background: var(--brand-50);
    color: var(--brand-700);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.feature-tile__icon .pi { font-size: 14px; }
.feature-tile__title {
    font-size: 12.5px; font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.feature-tile__desc {
    font-size: 11px; color: var(--text-muted);
    line-height: 1.45;
}
@media (max-width: 1100px) {
    .feature-tiles { grid-template-columns: 1fr; gap: var(--s-2); margin-top: var(--s-5); }
    .feature-tile { flex-direction: row; align-items: center; gap: var(--s-3); padding: 10px var(--s-3); }
    .feature-tile__icon { flex-shrink: 0; }
}

/* ============================================================================
   AI tip card (used on locked / mfa / forgot etc.)
   ============================================================================ */
.ai-tip {
    display: flex; gap: 10px;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--brand-50) 0%, #f9f6ff 100%);
    border: 1px solid var(--brand-100);
    border-radius: var(--r-3);
    margin: 0 0 var(--s-3);
    position: relative;
    overflow: hidden;
    text-align: left;
    font-size: 12.5px; line-height: 1.45;
}
.ai-tip::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 100% 100%, rgba(168,85,247,0.08) 0%, transparent 60%);
    pointer-events: none;
}
.ai-tip__mark {
    width: 26px; height: 26px;
    background: var(--brand-800);
    color: #fff;
    border-radius: var(--r-1);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.ai-tip__mark::after {
    content: ""; position: absolute;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--brand-500);
    top: -2px; right: -2px;
    box-shadow: 0 0 0 1.5px var(--brand-50);
    animation: lp-aiPulse 2.4s ease-in-out infinite;
}
.ai-tip__body { font-size: 12px; line-height: 1.5; color: var(--brand-800); position: relative; z-index: 1; }
.ai-tip__body strong { font-weight: 600; }

/* ============================================================================
   OTP / verification code input row
   ============================================================================ */
.otp-row,
.otp-input-group {
    display: flex; gap: 10px; justify-content: space-between;
    margin: var(--s-3) 0 var(--s-3);
}
.otp-row input,
.otp-input-group input {
    width: 48px; height: 56px;
    padding: 0;
    text-align: center;
    font-size: 22px; font-weight: 600;
    color: var(--brand-800);
    background: var(--surface);
    border: 1px solid #e2dcec;
    border-radius: var(--r-3);
    font-variant-numeric: tabular-nums;
    transition: border-color var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
    outline: none;
}
.otp-row input:focus,
.otp-input-group input:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px var(--brand-100);
}
.otp-meta {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: var(--text-muted);
    margin-bottom: var(--s-5);
}
.authenticator-input-bg .text-danger { margin-top: 6px; }

/* ============================================================================
   MFA method picker tiles
   ============================================================================ */
.method-list { display: flex; flex-direction: column; gap: var(--s-2); margin: var(--s-3) 0 var(--s-5); }
.method {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border: 1px solid var(--border);
    border-radius: var(--r-3);
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    color: var(--text);
    width: 100%;
    transition: border-color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
    font: inherit;
}
.method:hover {
    border-color: var(--brand-200);
    background: var(--brand-50);
    text-decoration: none;
}
.method.is-selected {
    border-color: var(--brand-500);
    background: var(--brand-50);
    box-shadow: 0 0 0 3px var(--brand-100);
}
.method__icon {
    width: 40px; height: 40px;
    border-radius: var(--r-2);
    background: var(--brand-100); color: var(--brand-700);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.method__body { flex: 1; min-width: 0; }
.method__name { font-size: 14px; font-weight: 600; color: var(--text); }
.method__hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.method__radio {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--border); flex-shrink: 0; position: relative;
}
.method.is-selected .method__radio { border-color: var(--brand-600); }
.method.is-selected .method__radio::after {
    content: ""; position: absolute; inset: 3px;
    border-radius: 50%; background: var(--brand-600);
}

/* ============================================================================
   QR enrollment block (MFA setup)
   ============================================================================ */
.qr-block {
    display: grid; grid-template-columns: 160px 1fr;
    gap: var(--s-4);
    padding: var(--s-4);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--r-3);
    margin: 0 0 var(--s-5);
}
@media (max-width: 480px) { .qr-block { grid-template-columns: 1fr; } }
.qr-fake {
    width: 160px; height: 160px;
    background:
        repeating-conic-gradient(var(--brand-800) 0% 25%, #fff 0% 50%) 0 0/16px 16px,
        var(--surface);
    border: 4px solid var(--surface);
    border-radius: var(--r-2);
    box-shadow: 0 0 0 1px var(--border);
}
.qr-info h4 { font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--text); }
.qr-info ol { margin: 0; padding-left: 18px; font-size: 12px; color: var(--text-secondary); line-height: 1.7; }
.qr-info ol li { margin-bottom: 2px; }
.qr-key {
    margin-top: var(--s-3);
    display: flex; align-items: center; gap: var(--s-2);
    padding: 6px 10px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--r-2);
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 12px;
    color: var(--brand-800);
    letter-spacing: 0.06em;
    word-break: break-all;
}

/* ============================================================================
   Banners
   ============================================================================ */
.banner {
    display: flex; gap: var(--s-2);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-3);
    font-size: 12.5px; line-height: 1.5;
    margin-bottom: var(--s-4);
    border: 1px solid;
    align-items: flex-start;
}
.banner .pi { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.banner__body { flex: 1; }
.banner__title { font-weight: 600; }
.banner--err  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.banner--err .pi { color: var(--error); }
.banner--warn { background: #fffbeb; border-color: #fde68a; color: #854d0e; }
.banner--warn .pi { color: var(--warning); }
.banner--ok   { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.banner--ok .pi { color: var(--success); }
.banner--info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.banner--info .pi { color: var(--info, #0369a1); }

/* Old MFA Authenticator field (.authenticator-input + .authenticator-input-bg) compat */
.authenticator-input-bg {
    margin-bottom: var(--s-4);
}
.authenticator-input {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid #e2dcec;
    border-radius: var(--r-3);
    box-shadow: 0 1px 2px rgba(31,14,61,0.03);
    transition: border-color var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
    outline: none;
}
.authenticator-input:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px var(--brand-100);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
