/* Login: split-panel layout */
.login-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    background: #f6f8fb;
}

.dark .login-shell {
    background: #00182E;
}

.login-brand-panel {
    display: none;
    width: 360px;
    flex-shrink: 0;
    background: #00182E;
    position: relative;
    overflow: hidden;
    border-right: 1px solid rgba(148, 163, 184, 0.14);
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, rgba(172, 236, 0, 0.05), transparent 34%),
      linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03));
    pointer-events: none;
}

.login-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 40px 36px;
}

.login-brand-logo {
    max-width: 220px;
    max-height: 64px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    background: none;
    padding: 0;
    border-radius: 0;
}

@media (min-width: 1024px) {
    .login-brand-panel {
        display: block;
    }
}

.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: transparent;
}

.login-form-panel::before {
    display: none;
}

.dark .login-form-panel {
    background: transparent;
}

.login-form-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-mobile-logo {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.login-mobile-logo-img {
    max-width: 180px;
    max-height: 52px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    background: none;
    padding: 0;
}

@media (min-width: 1024px) {
    .login-mobile-logo {
        display: none;
    }
}

/* Form elements */
.login-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.dark .login-label {
    color: #d1d5db;
}

.login-input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #111827;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-input::placeholder {
    color: #9ca3af;
}

.login-input:focus {
    outline: none;
    border-color: #00182E; /* brand.navy — navy ring is contrast-safe on the white form panel */
    box-shadow: 0 0 0 3px rgba(0, 24, 46, 0.12);
}

.dark .login-input {
    color: #f9fafb;
    background: #0b1728;
    border-color: rgba(148, 163, 184, 0.22);
}

.dark .login-input:focus {
    border-color: #A3E635; /* brand.green - visible on dark inputs */
    box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.18);
}

.dark .login-input::placeholder {
    color: #6b7280;
}

.auth-password-wrap .login-input {
    padding-right: 2.75rem;
}

.login-brand-panel .login-brand-tagline {
    color: rgba(203, 213, 225, 0.86);
}

.login-brand-panel .login-brand-feature-title {
    color: #f8fafc;
}

.login-brand-panel .login-brand-feature-desc {
    color: #94a3b8;
}

.light .login-form-panel {
    background: #f8fafc;
}

.light .login-form-panel h2,
.light .login-form-panel .login-form-heading {
    color: #0f172a;
}

.light .login-form-panel .login-form-subheading {
    color: #64748b;
}

/* Submit button */
/* Primary action: brand green fill + navy text (design-system.md button rule).
 * Hover/active use brightness (state tint tokens are not yet defined). */
.login-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #00182E; /* brand.navy */
    background: #A3E635; /* brand.green */
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: filter 0.15s, box-shadow 0.15s;
    box-shadow: none;
}

.login-submit-btn:hover {
  filter: brightness(0.94);
}

.login-submit-btn:focus-visible {
    outline: 2px solid #00182E; /* brand.navy ring on white panel */
    outline-offset: 2px;
}

.login-submit-btn:active {
    filter: brightness(0.88);
}

.login-submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Error banner */
.login-error {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 20px;
}

.dark .login-error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.login-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.75rem;
    border-radius: 9999px;
    background: rgba(172, 236, 0, 0.08);
    border: 1px solid rgba(172, 236, 0, 0.18);
    color: #0f172a;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-form-container.auth-shell-card {
    padding: 32px !important;
    border-radius: 8px;
}

.login-brand-inner .auth-kicker,
.login-form-container .auth-kicker {
    margin-bottom: 0.75rem;
}

.login-brand-inner .mt-auto {
    padding-top: 0;
}

.login-brand-inner .space-y-5 > * + * {
    margin-top: 1rem;
}

.login-brand-panel .w-8.h-8 {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.1);
}

.login-form-heading {
    font-size: 1.35rem;
    line-height: 1.25;
}

@media (max-width: 1023px) {
    .login-shell {
        display: block;
    }

    .login-form-panel {
        min-height: 100vh;
        padding: 24px 16px;
    }

    .login-form-container.auth-shell-card {
        padding: 24px !important;
    }
}

.dark .login-status-chip {
    color: #e2e8f0;
    background: rgba(172, 236, 0, 0.1);
}

.login-footnote {
    color: #64748b;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.dark .login-footnote {
    color: #94a3b8;
}

/* Spinner — navy on the green submit button for contrast */
.loading-spinner {
    border: 2px solid rgba(0, 24, 46, 0.25);
    border-top-color: #00182E; /* brand.navy */
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 0.6s linear infinite;
}

/* Auth links: navy in light mode (green fails contrast on white), green on dark. */
.login-link {
    color: #00182E; /* brand.navy */
    text-decoration: none;
}
.login-link:hover {
    color: #000000;
}
.dark .login-link {
    color: #A3E635; /* brand.green */
}
.dark .login-link:hover {
    color: #A3E635;
    opacity: 0.85;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Validation states */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08) !important;
}

.input-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08) !important;
}

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

@media (prefers-contrast: high) {
    .login-input { border-width: 2px; }
    .login-submit-btn { font-weight: 600; }
}
