/* ============================================================
   login.css
   Login page styles — Thesis Hub (TCPMS-laravel)
   Redesigned to match "image 1.png" reference — Fully Responsive
   ============================================================ */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Palette */
    --navy:           #1a3a6b;
    --navy-mid:       #224B8A;
    --indigo:         #1591DC;
    --indigo-hover:   #0d7ec5;
    --indigo-soft:    #dbeeff;
    --sky-start:      #6ec6f5;
    --sky-end:        #4aaee8;
    --success:        #10b981;
    --danger:         #ef4444;
    --warn:           #f59e0b;
    --surface:        #f0f8ff;
    --card:           #ffffff;
    --border:         #c8dff0;
    --text-main:      #1a3869;
    --text-muted:     #4a6b8c;
    --text-light:     #8bafc8;

    /* Typography */
    --font-sans: 'Poppins', system-ui, -apple-system, sans-serif;

    /* Radii */
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 24px;

    /* Shadows */
    --shadow-card: 0 20px 60px rgba(0, 80, 160, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--surface);
    color: var(--text-main);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   LOGIN PAGE LAYOUT
   ============================================================ */

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--surface);
}

/* ============================================================
   LEFT DECORATIVE PANEL
   ============================================================ */

.login-panel {
    background: #f0f6ff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding: clamp(24px, 3.2vw, 40px) clamp(28px, 4.2vw, 56px) clamp(28px, 4vh, 48px);
    position: relative;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
}

.login-panel::after {
    content: '';
    position: absolute;
    bottom: -110px;
    left: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(21, 145, 220, 0.08) 0%, rgba(21, 145, 220, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

/* Dot pattern background */
.login-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(44, 100, 180, 0.22) 1.4px, transparent 1.4px);
    background-size: 22px 22px;
    z-index: 0;
    pointer-events: none;
}

/* Brand header */
.panel-brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
    position: relative;
}

.panel-brand-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(21, 145, 220, 0.25));
}

.panel-brand-line,
.panel-logo-icon-th {
    width: 4px;
    height: 38px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #1591DC 0%, #1a4b9e 100%);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(21, 145, 220, 0.35);
}

.panel-logo-text-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.panel-logo-name {
    color: var(--navy);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.3px;
    line-height: 1.2;
}

.panel-logo-tagline {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Mobile/Tablet brand header (hidden on desktop where left panel is shown) */
.mobile-brand-header {
    display: none;
    align-items: center;
    gap: 11px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 18px 10px 12px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(13, 60, 120, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.75);
    position: relative;
    z-index: 1;
    max-width: 100%;
}

/* Center illustration area */
.panel-illustration-area {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    position: relative;
    width: 100%;
    padding: clamp(10px, 2vh, 24px) 0;
    overflow: hidden;
}

.panel-illustration-area::before {
    content: '';
    position: absolute;
    width: min(520px, 88%);
    aspect-ratio: 1 / 1;
    background: radial-gradient(circle, rgba(21, 145, 220, 0.15) 0%, rgba(21, 145, 220, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

.panel-illustration-img {
    /* Fit fully inside the area (no cropping/overlap); the art has hard edges so keep a margin */
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 100%;
    min-height: 0;
    border-radius: 24px;
    object-fit: contain;
    filter: drop-shadow(0 14px 30px rgba(21, 100, 200, 0.20));
    animation: panel-illustration-float 6s ease-in-out infinite;
}

@keyframes panel-illustration-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Quote block at bottom */
.panel-quote {
    z-index: 1;
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(21, 145, 220, 0.22);
    border-left: 4px solid var(--indigo);
    border-radius: var(--r-lg);
    padding: clamp(18px, 2.6vh, 26px) clamp(24px, 3.2vw, 36px);
    width: 100%;
    margin-bottom: clamp(34px, 5.2vh, 60px);
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(13, 60, 130, 0.10), 0 2px 8px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.panel-quote p {
    font-size: clamp(0.92rem, 1.08vw, 1.02rem);
    color: var(--text-muted);
    line-height: 1.6;
    text-align: center;
    font-style: italic;
}

.panel-quote strong {
    color: var(--navy);
    font-style: normal;
    font-weight: 700;
}

/* Legacy elements (hidden in new design, kept for compatibility) */
.panel-pill,
.panel-headline,
.panel-sub,
.panel-illustration,
.panel-progress { display: none; }

/* ============================================================
   RIGHT FORM SIDE — sky-blue gradient background
   ============================================================ */

.login-form-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: clamp(28px, 4vw, 48px) clamp(20px, 4.5vw, 64px);
    background: linear-gradient(160deg, #a8d8f0 0%, #68b8e8 35%, #3aa0d8 70%, #2490cc 100%);
    position: relative;
    overflow: hidden;
}

/* Subtle light orbs for depth */
.login-form-side::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    z-index: 0;
    pointer-events: none;
}

.login-form-side::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -60px;
    width: 240px; height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    z-index: 0;
    pointer-events: none;
}

/* Card */
.login-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
    padding: clamp(28px, 3.6vw, 38px) clamp(20px, 2.5vw, 28px);
    position: relative;
    z-index: 1;
}

/* Remove the top accent bar from old design */
.login-card-top-accent { display: none; }

/* Card header */
.login-card-header {
    margin-bottom: clamp(20px, 2.8vh, 26px);
    text-align: center;
}

.header-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 0;
    margin-bottom: 18px;
    background: none;
    width: 100%;
}

/* ── Dual brand lockup (CSD | TCPMS) ──
   Two equal halves around a centered divider. Text wraps naturally,
   so the lockup never overflows the card at any width. */
.header-dual-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.header-brand-item {
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-brand-item:first-child { justify-content: flex-end; }
.header-brand-item:last-child  { justify-content: flex-start; }

.header-brand-logo {
    flex-shrink: 0;
    display: block;
    transition: transform 0.25s ease;
}

.header-brand-logo-csd {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 50%;
}

/* TCPMS art has transparent space above/below — crop it so the mark reads at the same visual size */
.header-brand-logo-tcpms {
    width: 66px;
    height: 42px;
    object-fit: cover;
    object-position: center;
}

.header-brand-item:hover .header-brand-logo {
    transform: scale(1.05);
}

.header-brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    text-align: left;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0;
    color: #156ba8;
    text-transform: uppercase;
}

/* Each label is always exactly 2 lines (one per span) */
.header-brand-text span {
    display: block;
    white-space: nowrap;
}

.header-brand-divider {
    width: 1px;
    align-self: stretch;
    min-height: 40px;
    background: #cfe0ed;
    flex-shrink: 0;
}

.header-icon-inner {
    width: 52px; height: 52px;
    background: var(--indigo-soft);
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    color: var(--indigo);
    font-size: 1.6rem;
}

.login-card-header h1 {
    font-size: clamp(1.32rem, 2.2vw, 1.55rem);
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -.5px;
    margin-bottom: 4px;
    line-height: 1.25;
}

.login-card-header p {
    color: var(--text-muted);
    font-size: clamp(0.82rem, 1.1vw, 0.88rem);
    margin-top: 4px;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */

.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 7px;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.input-wrap { position: relative; }

.input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.05rem;
    pointer-events: none;
    display: flex;
}

.input-action-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    color: var(--text-light);
    font-size: 1.05rem;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    touch-action: manipulation;
}

.input-action-icon:hover { color: var(--text-main); }

.form-input {
    width: 100%;
    min-height: 44px;
    padding: 11px 42px 11px 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-family: var(--font-sans);
    font-size: .88rem;
    color: var(--text-main);
    background: #fafcff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(21, 145, 220, 0.15);
    background: #fff;
}

.form-input::placeholder { color: #b0c4d8; }

/* Remember me + forgot password row */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 20px;
    margin-top: 4px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .84rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    transition: color .15s ease;
    touch-action: manipulation;
}

.checkbox-label:hover {
    color: var(--navy);
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background-color: #fafcff;
    cursor: pointer;
    display: inline-grid;
    place-content: center;
    transition: all .2s ease;
    margin: 0;
    vertical-align: middle;
    position: relative;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:hover {
    border-color: var(--indigo);
    background-color: #f0f7ff;
}

.checkbox-label input[type="checkbox"]:focus-visible {
    outline: none;
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(21, 145, 220, 0.2);
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: var(--indigo);
    border-color: var(--indigo);
}

.checkbox-label input[type="checkbox"]::after {
    content: "";
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .15s ease-in-out;
    margin-top: -2px;
}

.checkbox-label input[type="checkbox"]:checked::after {
    transform: rotate(45deg) scale(1);
}

.forgot-link {
    font-family: inherit;
    font-size: .82rem;
    color: var(--indigo);
    text-decoration: none;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    transition: color .15s;
    padding: 4px 0;
    touch-action: manipulation;
}

.forgot-link:hover { color: var(--navy); text-decoration: underline; }

/* Submit button */
.btn-login {
    width: 100%;
    min-height: 46px;
    padding: 13px 16px;
    background: var(--indigo);
    color: #fff;
    border: none;
    border-radius: var(--r-sm);
    font-family: var(--font-sans);
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(21, 145, 220, 0.30);
    letter-spacing: .2px;
    touch-action: manipulation;
}

.btn-login:hover {
    background: var(--indigo-hover);
    box-shadow: 0 6px 18px rgba(13, 126, 197, 0.40);
}

.btn-login:active { transform: translateY(1px); }

.btn-login:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* SSO Divider */
.sso-divider {
    position: relative;
    text-align: center;
    margin: 24px 0 18px;
}

.sso-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 1px;
    background: var(--border);
    z-index: 0;
}

.sso-divider span {
    position: relative;
    background: #fff;
    padding: 0 12px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 1;
}

/* Help text */
.help-text {
    text-align: center;
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.help-text a {
    color: var(--indigo);
    text-decoration: none;
    font-weight: 600;
}

.help-text a:hover { text-decoration: underline; }

/* ============================================================
   ALERTS (flash messages)
   ============================================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--r-sm);
    font-size: .84rem;
    font-weight: 500;
    line-height: 1.48;
    margin-bottom: 18px;
    border: 1px solid transparent;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
    border-left: 4px solid #2563eb;
}

.alert-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin-right: 6px;
    vertical-align: middle;
}

.alert-pill-warning {
    background: #f59e0b;
    color: #ffffff;
}

.alert-pill-info {
    background: #2563eb;
    color: #ffffff;
}

.alert-pill-danger {
    background: #dc2626;
    color: #ffffff;
}

.alert-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ============================================================
   FIELD-LEVEL ERROR
   ============================================================ */

.form-input.is-invalid { border-color: var(--danger); }
.form-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }

.field-error-text {
    margin-top: 5px;
    font-size: 0.78rem;
    color: var(--danger);
    font-weight: 500;
    line-height: 1.4;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS (ALL DEVICES & ORIENTATIONS)
   ============================================================ */

/* 1. Large Desktop & Ultrawide Monitors (1600px+) */
@media (min-width: 1600px) {
    .login-panel {
        padding: 56px 80px;
        align-items: center;
    }
    .panel-brand-header {
        align-self: flex-start;
    }
    .panel-illustration-img {
        max-width: 620px;
    }
    .panel-quote {
        max-width: 680px;
    }
    .login-card {
        max-width: 472px;
        padding: 42px 32px;
    }
}

/* 2. Compact Laptops & Split-Screen Desktops (993px – 1199px) */
@media (min-width: 993px) and (max-width: 1199px) {
    .login-panel {
        padding: 32px 28px 36px;
    }
    .login-form-side {
        padding: 32px 24px;
    }
    .login-card {
        max-width: 420px;
        padding: 30px 22px;
    }
    .header-dual-brand {
        gap: 10px;
    }
    .header-brand-item {
        gap: 6px;
    }
    .header-brand-logo-csd {
        width: 38px;
        height: 38px;
    }
    .header-brand-logo-tcpms {
        width: 58px;
        height: 38px;
    }
    .header-brand-text {
        font-size: 0.54rem;
    }
    .panel-quote {
        padding: 20px 28px;
        margin-bottom: 34px;
    }
}

/* 3. Short-Height Laptops (e.g. 1366x768, 1280x720) — prevent vertical clipping */
@media (min-width: 993px) and (max-height: 780px) {
    .login-panel {
        padding: 20px 32px 24px;
    }
    .panel-illustration-area {
        padding: 6px 0;
    }
    .panel-illustration-img {
        max-height: 100%;
    }
    .panel-quote {
        padding: 16px 24px;
        margin-bottom: 28px !important;
        border-radius: 16px;
        margin-bottom: 12px;
    }
    .panel-quote p {
        font-size: 0.86rem;
        line-height: 1.55;
    }
    .login-form-side {
        padding: 20px 32px;
    }
    .login-card {
        padding: 26px 28px;
    }
    .header-icon-wrap {
        margin-bottom: 14px;
    }
    .header-brand-logo-csd {
        width: 42px;
        height: 42px;
    }
    .header-brand-logo-tcpms {
        width: 66px;
        height: 42px;
    }
    .login-card-header {
        margin-bottom: 16px;
    }
    .form-group {
        margin-bottom: 14px;
    }
}

/* 4. Tablets — iPad / Surface / Android Portrait & Compact Landscape (<= 992px) */
@media (max-width: 992px) {
    .login-page {
        grid-template-columns: 1fr;
    }
    .login-panel {
        display: none;
    }
    /* The card already carries both logos, so the extra floating brand pill is not needed */
    .mobile-brand-header {
        display: none;
    }
    .login-form-side {
        min-height: 100vh;
        min-height: 100dvh;
        padding: max(28px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
        gap: 22px;
    }
    .login-card {
        max-width: 460px;
        padding: 34px 28px;
    }
}

/* 5. Smartphones — Standard & Large Phones (<= 640px) */
@media (max-width: 640px) {
    .login-form-side {
        padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
        gap: 16px;
    }
    .login-card {
        max-width: 100%;
        border-radius: 20px;
        padding: 28px 20px;
        box-shadow: 0 16px 40px rgba(0, 60, 130, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);
    }
    .header-icon-wrap {
        margin-bottom: 16px;
    }
    .header-brand-text {
        font-size: 0.56rem;
    }
    .login-card-header {
        margin-bottom: 18px;
    }
    .login-card-header h1 {
        font-size: 1.38rem;
    }
    .login-card-header p {
        font-size: 0.84rem;
    }
    /* 16px font-size prevents iOS Safari automatic page zoom on input focus */
    .form-input {
        font-size: 16px;
        min-height: 48px;
        padding: 12px 42px 12px 38px;
    }
    .input-action-icon {
        width: 40px;
        height: 40px;
    }
    .btn-login {
        min-height: 48px;
        font-size: 0.96rem;
    }
    .alert {
        font-size: 0.81rem;
        padding: 10px 12px;
        margin-bottom: 15px;
    }
}

/* 5b. Phones (<= 480px) — stack each logo above its label so nothing gets cramped */
@media (max-width: 480px) {
    .header-dual-brand {
        align-items: flex-start;
        gap: 12px;
    }
    .header-brand-item,
    .header-brand-item:first-child,
    .header-brand-item:last-child {
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 6px;
    }
    .header-brand-logo-csd {
        width: 46px;
        height: 46px;
    }
    .header-brand-logo-tcpms {
        width: 72px;
        height: 46px;
    }
    .header-brand-text {
        align-items: center;
        text-align: center;
        font-size: 0.52rem;
    }
    .header-brand-divider {
        align-self: center;
        min-height: 64px;
    }
}

/* 6. Compact Phones (iPhone SE, 360px–380px Androids) */
@media (max-width: 380px) {
    .login-form-side {
        padding: max(16px, env(safe-area-inset-top)) 12px max(20px, env(safe-area-inset-bottom));
        gap: 12px;
    }
    .login-card {
        padding: 24px 16px;
        border-radius: 18px;
    }
    .header-dual-brand {
        gap: 10px;
    }
    .header-brand-logo-csd {
        width: 40px;
        height: 40px;
    }
    .header-brand-logo-tcpms {
        width: 64px;
        height: 40px;
    }
    .header-brand-text {
        font-size: 0.5rem;
    }
    .header-brand-divider {
        min-height: 56px;
    }
    .login-card-header h1 {
        font-size: 1.26rem;
    }
    .checkbox-label,
    .forgot-link {
        font-size: 0.8rem;
    }
}

/* 7. Ultra-Narrow / Foldable Outer Screens (<= 320px) */
@media (max-width: 320px) {
    .login-card {
        padding: 20px 12px;
        border-radius: 16px;
    }
    .header-dual-brand {
        gap: 8px;
    }
    .header-brand-text {
        font-size: 0.46rem;
    }
    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* 8. Phone Landscape Mode (short viewport height) — keep the lockup horizontal and compact */
@media (max-width: 992px) and (max-height: 580px) and (orientation: landscape) {
    .login-form-side {
        justify-content: flex-start;
        padding: 16px max(20px, env(safe-area-inset-right)) 24px max(20px, env(safe-area-inset-left));
        gap: 12px;
    }
    .login-card {
        max-width: 500px;
        padding: 20px 24px;
    }
    .header-icon-wrap {
        margin-bottom: 10px;
    }
    .header-dual-brand {
        align-items: center;
    }
    .header-brand-item,
    .header-brand-item:first-child,
    .header-brand-item:last-child {
        flex-direction: row;
        gap: 6px;
    }
    .header-brand-item:first-child { justify-content: flex-end; }
    .header-brand-item:last-child  { justify-content: flex-start; }
    .header-brand-logo-csd {
        width: 36px;
        height: 36px;
    }
    .header-brand-logo-tcpms {
        width: 56px;
        height: 36px;
    }
    .header-brand-text {
        align-items: flex-start;
        text-align: left;
        font-size: 0.56rem;
    }
    .header-brand-divider {
        align-self: stretch;
        min-height: 32px;
    }
    .login-card-header {
        margin-bottom: 12px;
    }
    .login-card-header h1 {
        font-size: 1.2rem;
    }
    .form-group {
        margin-bottom: 12px;
    }
}

/* 9. Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    .panel-illustration-img {
        animation: none;
    }
    .header-brand-logo,
    .btn-login,
    .form-input {
        transition: none;
    }
}