/* =========================================================
   SM Zentrix OPD — Login Page (Professional Healthcare)
   Two-panel layout: dark navy brand left · clean white form right
   ========================================================= */

:root {
    --login-primary:   #1769aa;
    --login-secondary: #1aa6a6;
    --login-accent:    #0ea5e9;
    --login-check:     #1aa6a6;
    --login-text:      #0f172a;
    --login-muted:     #64748b;
    --login-border:    #dbeafe;
    --login-card-bg:   #ffffff;
    --login-shadow:    0 24px 64px rgba(10, 22, 40, 0.13);
    --login-radius:    16px;
    --login-input-h:   48px;
    --login-default-primary:   #1769aa;
    --login-default-secondary: #1aa6a6;
    --login-default-accent:    #0ea5e9;
    /* Logo carousel sizing — stage fills the white brand frame on desktop */
    --login-showcase-card-width: 100%;
    --login-showcase-card-height: clamp(190px, 24vw, 260px);
    --login-showcase-step: 4s;
    --login-showcase-count: 9;
    --login-showcase-duration: calc(var(--login-showcase-count) * var(--login-showcase-step));
    --login-logo-zoom: 1.32;
}

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

/* ── Page shell ──────────────────────────────────────── */
body.login-premium {
    min-height: 100vh;
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--login-text);
    background: #eef2f7;
    overflow-x: hidden;
}

/* Subtle ambient layer with dot grid pattern */
.login-bg-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(15, 44, 100, 0.07), transparent 50%),
        radial-gradient(circle at 85% 75%, rgba(14, 165, 233, 0.05), transparent 45%),
        radial-gradient(circle at 50% 100%, rgba(26, 166, 166, 0.04), transparent 40%),
        radial-gradient(1.5px 1.5px at center, rgba(23, 105, 170, 0.14) 1px, transparent 0) 0 0 / 28px 28px;
}

/* ECG decoration — very subtle watermark at bottom */
.login-bg-ecg {
    position: fixed;
    inset: auto 0 0 0;
    height: 80px;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80' preserveAspectRatio='none'%3E%3Cpath d='M0 40 H120 L150 40 L180 10 L210 68 L240 40 H360 L390 22 L420 60 L450 40 H1200' fill='none' stroke='%231769aa' stroke-width='2'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
}

/* ── Two-column grid ─────────────────────────────────── */
.login-shell {
    position: relative;
    z-index: 1;
    width: min(1260px, 96vw);
    margin: 0 auto;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(340px, 1.1fr) minmax(360px, 480px);
    gap: clamp(24px, 3vw, 48px);
    align-items: center;
    padding: clamp(20px, 3vw, 44px);
}

/* ── LEFT: Dark professional brand panel ─────────────── */
.login-brand-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: clamp(24px, 2.5vw, 36px) clamp(20px, 2vw, 32px);
    background: linear-gradient(165deg, #0a1628 0%, #0d2044 55%, #102954 100%);
    border-radius: calc(var(--login-radius) + 4px);
    box-shadow:
        0 20px 56px rgba(10, 22, 40, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    color: #ffffff;
    min-height: clamp(540px, 72vh, 780px);
    position: relative;
    overflow: hidden;
}

/* Subtle inner glow/texture on the dark panel */
.login-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 10%, rgba(96, 165, 250, 0.08), transparent 50%),
        radial-gradient(circle at 10% 90%, rgba(20, 184, 166, 0.07), transparent 45%);
    pointer-events: none;
}

/* ── Logo box inside dark panel ──────────────────────── */
@keyframes brandFloat {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-7px); }
}

@keyframes brandReveal {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.brand-logo-wrap {
    width: min(100%, 460px);
    border-radius: calc(var(--login-radius) + 4px);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255,255,255,0.05) inset;
    padding: 14px;
    position: relative;
    z-index: 1;
    animation: brandReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.brand-logo-frame {
    position: relative;
    border-radius: var(--login-radius);
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.brand-logo-frame:has(.single-brand-logo:not([hidden])) {
    display: flex;
    justify-content: center;
}

/* ── Carousel ────────────────────────────────────────── */
.product-showcase {
    display: block;
}

.product-showcase[hidden],
.single-brand-logo[hidden] {
    display: none !important;
}

#productShowcase:not([hidden]) + #singleBrandLogo {
    display: none !important;
}

.single-brand-logo {
    display: grid;
    place-items: center;
    gap: 12px;
    padding: 10px 12px;
    min-height: 0;
    width: 100%;
    text-align: center;
}

.single-brand-logo .logo-showcase-box--static {
    margin: 0 auto;
    width: 100%;
    max-width: none;
    height: var(--login-showcase-card-height);
    min-height: var(--login-showcase-card-height);
    padding: 6px 8px;
}

.single-brand-logo .logo-showcase-box--static .logo-stage {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.single-brand-logo .logo-showcase-img--static {
    position: relative;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    object-position: center;
    transform: scale(var(--login-logo-zoom));
    transform-origin: center;
    opacity: 1;
    animation: logoPulse 6s ease-in-out infinite;
}

.single-brand-logo .single-brand-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--login-primary);
}

.single-brand-logo .single-brand-tagline {
    margin: 0;
    font-size: 0.86rem;
    color: var(--login-muted);
    line-height: 1.35;
    max-width: 28ch;
}

@keyframes logoPulse {
    0% {
        transform: scale(calc(var(--login-logo-zoom) * 0.98));
    }
    50% {
        transform: scale(var(--login-logo-zoom));
    }
    100% {
        transform: scale(calc(var(--login-logo-zoom) * 0.98));
    }
}

.showcase-viewport {
    position: relative;
    width: 100%;
    min-height: calc(var(--login-showcase-card-height) + 44px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    padding: 10px 12px 4px;
    --showcase-count: var(--login-showcase-count);
    --showcase-step: var(--login-showcase-step);
    --showcase-duration: calc(var(--showcase-count) * var(--showcase-step));
}

.showcase-card,
.logo-showcase-box {
    position: relative;
    width: 100%;
    max-width: none;
    height: var(--login-showcase-card-height);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0;
    flex-shrink: 0;
    background: #ffffff;
}

.logo-showcase-box:not(.logo-showcase-box--static) {
    height: var(--login-showcase-card-height);
}

.logo-showcase-box--static {
    height: var(--login-showcase-card-height);
    min-height: var(--login-showcase-card-height);
}

.logo-stage {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.showcase-logo,
.clinic-showcase-logo img,
.logo-showcase-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center;
    transform: scale(var(--login-logo-zoom));
    transform-origin: center;
    display: block;
    background: transparent;
    opacity: 0;
    animation:
        logoFadeCycle var(--showcase-duration) ease-in-out infinite,
        logoPulse 6s ease-in-out infinite;
    will-change: opacity, transform;
}

@keyframes logoFadeCycle {
    0% {
        opacity: 0;
    }
    2.22% {
        opacity: 1;
    }
    7.78% {
        opacity: 1;
    }
    11.11% {
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

.showcase-tagline-track {
    position: relative;
    width: 100%;
    min-height: 2.6em;
    margin-top: 10px;
    text-align: center;
}

.showcase-tagline-item {
    position: absolute;
    inset: 0;
    margin: 0 auto;
    padding: 0 12px;
    font-size: 0.83rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.4;
    max-width: 32ch;
    width: 100%;
    opacity: 0;
    animation: showcaseTaglineCycle var(--showcase-duration) ease-in-out infinite;
}

@keyframes showcaseTaglineCycle {
    0% { opacity: 0; }
    2.22% { opacity: 1; }
    7.78% { opacity: 1; }
    11.11% { opacity: 0; }
    100% { opacity: 0; }
}

.showcase-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 10px;
    background: #ffffff;
    --showcase-count: var(--login-showcase-count);
    --showcase-step: var(--login-showcase-step);
    --showcase-duration: calc(var(--showcase-count) * var(--showcase-step));
}

.showcase-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1);
    animation: showcaseDotCycle var(--showcase-duration) ease-in-out infinite;
}

@keyframes showcaseDotCycle {
    0% {
        background: rgba(255, 255, 255, 0.28);
        transform: scale(1);
    }
    2.22% {
        background: #38bdf8;
        transform: scale(1.25);
    }
    7.78% {
        background: #38bdf8;
        transform: scale(1.25);
    }
    11.11% {
        background: rgba(255, 255, 255, 0.28);
        transform: scale(1);
    }
    100% {
        background: rgba(255, 255, 255, 0.28);
        transform: scale(1);
    }
}

/* ── Hero text on dark panel ─────────────────────────── */
.brand-hero-desktop {
    position: relative;
    z-index: 1;
}

.brand-name {
    margin: 0;
    font-size: clamp(1.65rem, 2.8vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.12;
}

.brand-tagline {
    margin: 6px 0 0;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    max-width: 38ch;
}

.brand-tagline-accent {
    color: #38d9c0;
    font-weight: 700;
}

/* ── Trust badges on dark panel ─────────────────────── */
.brand-trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    position: relative;
    z-index: 1;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.2;
}

.trust-badge::before {
    content: "✓";
    color: #34d399;
    font-weight: 900;
}

/* ── Feature list on dark panel ─────────────────────── */
.brand-features-panel {
    border: 0;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1;
}

.brand-features-panel summary {
    display: none;
}

.brand-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 18px;
}

.brand-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.35;
}

.brand-features li::before {
    content: "✓";
    color: #34d399;
    font-weight: 800;
    flex-shrink: 0;
}

/* ── Footer on dark panel ────────────────────────────── */
.brand-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.84rem;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

.brand-footer strong {
    display: block;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
}

/* ── RIGHT: Clean white login card ───────────────────── */
.login-card-panel {
    width: 100%;
}

.login-card {
    background: #ffffff;
    border: 0;
    border-radius: calc(var(--login-radius) + 4px);
    box-shadow:
        0 20px 60px rgba(10, 22, 40, 0.11),
        0 4px 16px rgba(10, 22, 40, 0.06);
    padding: clamp(24px, 3vw, 36px);
}

/* ── Hero claim above form ────────────────────────────── */
.login-hero-claim {
    margin: 0 0 10px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--login-primary), var(--login-accent, var(--login-secondary)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.login-card h2 {
    margin: 0 0 6px;
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.login-help {
    margin: 0 0 20px;
    color: var(--login-muted);
    line-height: 1.5;
    font-size: 0.93rem;
}

/* ── Messages ────────────────────────────────────────── */
.login-message {
    margin: 0 0 12px;
    color: #991b1b;
    font-weight: 700;
    line-height: 1.4;
    font-size: 0.92rem;
}

.login-message.is-offline {
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 10px 12px;
}

/* ── Form fields ─────────────────────────────────────── */
.login-fields {
    display: grid;
    gap: 16px;
}

.login-field {
    margin: 0;
}

.login-field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    color: #1e293b;
    font-size: 0.91rem;
    letter-spacing: 0.01em;
}

.login-field input {
    width: 100%;
    min-height: var(--login-input-h);
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 16px;
    background: #f8fafc;
    color: var(--login-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-field input:focus {
    outline: none;
    border-color: var(--login-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--login-primary) 15%, transparent);
}

.password-field-wrap {
    position: relative;
}

.password-field-wrap input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--login-muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: #f1f5f9;
    color: var(--login-primary);
    outline: none;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: var(--login-muted);
    font-size: 0.83rem;
    line-height: 1.35;
}

/* ── Sign In button ──────────────────────────────────── */
.login-actions {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.btn-sign-in {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--login-primary), var(--login-accent, var(--login-secondary)));
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    letter-spacing: 0.02em;
    box-shadow:
        0 6px 20px color-mix(in srgb, var(--login-primary) 30%, transparent),
        0 2px 6px color-mix(in srgb, var(--login-primary) 20%, transparent);
    transition: filter 0.15s ease, transform 0.12s ease;
}

.btn-sign-in:hover {
    filter: brightness(0.97);
    transform: translateY(-1px);
}

.btn-sign-in:active {
    transform: translateY(0);
}

.btn-sign-in:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--login-primary) 35%, transparent);
    outline-offset: 2px;
}

.btn-sign-in:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* ── 3 micro-trust badges below Sign In ─────────────── */
.login-trust-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 14px;
    padding: 10px 4px;
    border-top: 1px solid #f1f5f9;
}

.login-trust-badge {
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

/* ── Demo Login button ───────────────────────────────── */
.btn-demo-login {
    width: 100%;
    min-height: 46px;
    margin-top: 8px;
    border: 1.5px dashed color-mix(in srgb, var(--login-primary) 40%, #bfdbfe);
    border-radius: 12px;
    background: color-mix(in srgb, var(--login-primary) 5%, #f0f9ff);
    color: var(--login-primary);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.btn-demo-login:hover {
    background: color-mix(in srgb, var(--login-primary) 10%, #e0f2fe);
    border-color: var(--login-primary);
    transform: translateY(-1px);
}

.btn-demo-login:active {
    transform: translateY(0);
}

/* ── Tutorials button ────────────────────────────────── */
.btn-tutorials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    margin-top: 12px;
    border-radius: 10px;
    border: 1.5px solid color-mix(in srgb, var(--login-primary) 22%, #bfdbfe);
    background: color-mix(in srgb, var(--login-primary) 4%, #f8fbff);
    color: var(--login-primary);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.93rem;
}

.btn-tutorials:hover {
    background: color-mix(in srgb, var(--login-primary) 8%, #eff6ff);
}

.tutorials-help {
    margin: 5px 0 0;
    text-align: center;
    color: #64748b;
    font-size: 0.82rem;
}

/* ── Support block ───────────────────────────────────── */
.login-support {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e8edf4;
}

.login-support-title {
    margin: 0 0 8px;
    font-size: 0.88rem;
    font-weight: 800;
    color: #1e293b;
}

.login-support-links {
    display: grid;
    gap: 5px;
    font-size: 0.86rem;
}

.login-support-links a {
    color: var(--login-primary);
    text-decoration: none;
    font-weight: 600;
    word-break: break-word;
}

.login-support-links a:hover {
    text-decoration: underline;
}

.login-support-links .support-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ── Advanced options ────────────────────────────────── */
.login-advanced {
    margin-top: 12px;
    border: 1px solid #e8edf4;
    border-radius: 12px;
    background: #fafafa;
    padding: 0 12px;
}

.login-advanced summary {
    cursor: pointer;
    font-weight: 700;
    color: #475569;
    padding: 11px 2px;
    list-style: none;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.login-advanced summary::-webkit-details-marker {
    display: none;
}

.login-advanced summary::after {
    content: "▾";
    margin-left: auto;
    font-size: 0.82rem;
    transition: transform 0.15s ease;
}

.login-advanced[open] summary::after {
    transform: rotate(180deg);
}

.login-advanced-body {
    padding: 0 2px 12px;
    display: grid;
    gap: 8px;
}

.refresh-license-button {
    width: 100%;
    min-height: 42px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: var(--login-primary);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
}

.license-refresh-status {
    font-size: 0.85rem;
    color: #64748b;
}

.license-refresh-status.is-success { color: #15803d; }
.license-refresh-status.is-error   { color: #b91c1c; }

/* ── System status (moved to Advanced section) ───────── */
.system-status {
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 0.83rem;
    line-height: 1.4;
    text-align: center;
}

.system-status[data-state="online"]  { border-color: #bbf7d0; background: #f0fdf4; }
.system-status[data-state="offline"] { border-color: #fed7aa; background: #fff7ed; }
.system-status[data-state="pending"] { border-color: #fde68a; background: #fffbeb; }
.system-status[data-state="error"]   { border-color: #fecaca; background: #fef2f2; }

.system-status-label  { font-weight: 700; color: #1e293b; }
.system-status-detail { color: #64748b; margin-top: 2px; font-size: 0.79rem; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Tablet: 641 – 1024px (2-col with narrower left) */
@media (min-width: 641px) and (max-width: 1024px) {
    .login-shell {
        grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
        gap: 20px;
        align-items: start;
        padding-top: 28px;
        padding-bottom: 28px;
    }

    .login-brand-panel {
        min-height: 0;
    }

    .brand-features-panel summary {
        display: none;
    }
}

/* Tablet Portrait: 641px - 1024px in portrait orientation — 100% width/height fullscreen */
@media (min-width: 641px) and (max-width: 1024px) and (orientation: portrait) {
    body.login-premium {
        height: 100vh;
        overflow: hidden;
    }

    .login-shell {
        width: 100%;
        height: 100vh;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        padding: 0;
        gap: 0;
        align-items: stretch;
    }

    .login-brand-panel {
        display: none;
    }

    .login-card-panel {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .login-card {
        border-radius: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 24px 20px;
    }

    /* Adjust background layer for fullscreen */
    .login-bg-layer {
        inset: 0;
    }

    .login-bg-ecg {
        display: none;
    }
}


/* Mobile: ≤ 640px — collapse to single column */
@media (max-width: 640px) {
    :root {
        --login-showcase-card-width: 100%;
        --login-showcase-card-height: clamp(176px, 52vw, 220px);
        --login-logo-zoom: 1.28;
    }

    .login-shell {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 12px 14px 24px;
        gap: 12px;
    }

    /* On mobile the brand panel is flattened via display:contents
       so we need to style the individual children */
    .login-brand-panel {
        display: contents;
    }

    /* Logo box — light card on mobile */
    .brand-logo-wrap {
        order: 1;
        width: 100%;
        max-width: 360px;
        align-self: center;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid #e2e8f0;
        box-shadow: 0 8px 24px rgba(10, 22, 40, 0.08);
        padding: 12px;
    }

    /* Carousel tagline — normal color on mobile */
    .showcase-tagline-item {
        color: #64748b;
    }

    /* Login card */
    .login-card-panel {
        order: 2;
        width: 100%;
    }

    .login-card {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .login-card h2 {
        font-size: 1.35rem;
    }

    /* Trust badges */
    .brand-trust-badges {
        order: 3;
        justify-content: center;
        align-self: center;
        width: min(100%, 420px);
    }

    .trust-badge {
        background: rgba(255, 255, 255, 0.85);
        border-color: #e2e8f0;
        color: #334155;
    }

    .trust-badge::before {
        color: var(--login-check);
    }

    /* Features */
    .brand-features-panel {
        order: 4;
        align-self: center;
        width: min(100%, 420px);
    }

    .brand-features-panel summary {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 10px 12px;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.9);
        font-weight: 700;
        color: #334155;
        cursor: pointer;
        list-style: none;
        width: 100%;
    }

    .brand-features-panel summary::-webkit-details-marker {
        display: none;
    }

    .brand-features-panel summary::after {
        content: "▾";
        margin-left: auto;
        font-size: 0.8rem;
    }

    .brand-features {
        grid-template-columns: 1fr;
        margin: 8px 0 0;
        padding: 0 4px;
    }

    .brand-features li {
        color: #334155;
    }

    .brand-features li::before {
        color: var(--login-check);
    }

    /* Hero text hidden on mobile (logo + card is enough) */
    .brand-hero-desktop {
        display: none;
    }

    /* Footer */
    .brand-footer {
        order: 5;
        display: block;
        text-align: center;
        align-self: center;
        width: min(100%, 420px);
        font-size: 0.8rem;
        border-top: 1px solid #e2e8f0;
        color: #475569;
    }

    .brand-footer strong {
        color: #1e293b;
    }

    .login-field input {
        min-height: 50px;
    }
}

/* Desktop: always show features inline, hide summary toggle */
@media (min-width: 641px) {
    .brand-features-panel summary {
        display: none;
    }
}

/* Reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .logo-showcase-img,
    .showcase-tagline-item,
    .showcase-dot {
        animation: none !important;
    }

    .logo-showcase-img:first-child,
    .showcase-tagline-item:first-child,
    .showcase-dot:first-child {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    .showcase-tagline-item:first-child {
        transform: none;
    }

    .showcase-dot:first-child {
        background: #38bdf8;
        transform: scale(1.25);
    }

    .brand-logo-wrap {
        animation: none;
    }

    .btn-sign-in:hover,
    .btn-demo-login:hover {
        transform: none;
    }
}
