/* Login page layout. Metronic supplies the components (kt-card, kt-input, kt-btn ...); layout is plain CSS
   because the shipped styles.css only contains the Tailwind utilities its demos happen to use. */

html, body { height: 100%; margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

.login-shell { display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }

/* ---------- Image side (left) ---------- */
.login-hero { position: relative; overflow: hidden; min-height: 150px; background: #0b2a4a; }
.hero-slide {
    position: absolute; inset: 0; background-size: cover; background-position: center;
    opacity: 0; animation: heroFade 32s infinite; transform: scale(1.04);
}
.hero-slide:nth-child(1) { animation-delay: 0s; }
.hero-slide:nth-child(2) { animation-delay: 8s; }
.hero-slide:nth-child(3) { animation-delay: 16s; }
.hero-slide:nth-child(4) { animation-delay: 24s; }
@keyframes heroFade {
    0%   { opacity: 0; transform: scale(1.04); }
    4%   { opacity: 1; }
    25%  { opacity: 1; }
    29%  { opacity: 0; }
    100% { opacity: 0; transform: scale(1.10); }
}
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(6, 24, 46, .55) 0%, rgba(6, 24, 46, .05) 30%, rgba(6, 24, 46, .55) 62%, rgba(6, 24, 46, .93) 100%);
}
.hero-content { display: none; }

/* ---------- Form side (right) ---------- */
.login-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: var(--background, #fff); }
.login-card { width: 100%; max-width: 420px; box-shadow: 0 10px 40px -12px rgba(15, 23, 42, .18); }
.login-form { display: flex; flex-direction: column; gap: 1.25rem; padding: 2.25rem; }
/* The logo artwork is dark navy, so it sits on a light chip to stay readable in dark mode too. */
.login-logo { height: 58px; width: auto; align-self: flex-start; object-fit: contain; padding: .35rem .75rem; border-radius: .6rem; background: #fff; border: 1px solid rgba(100, 116, 139, .25); }
.login-heading h1 { margin: 0 0 .35rem; font-size: 1.5rem; line-height: 1.2; font-weight: 600; color: var(--mono, inherit); }
.login-heading p { margin: 0; font-size: .875rem; color: var(--muted-foreground, #64748b); }
.login-field { display: flex; flex-direction: column; gap: .375rem; }
.login-password { display: flex; align-items: center; gap: .25rem; padding-inline-end: .25rem; }
.login-password input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; }
.login-caps { color: #b45309; display: flex; align-items: center; gap: .3rem; }
.login-submit { width: 100%; justify-content: center; height: 2.75rem; font-weight: 600; }
.login-submit[disabled] { opacity: .75; cursor: progress; }
.login-note { margin: 0; display: flex; gap: .45rem; align-items: flex-start; font-size: .75rem; line-height: 1.4; color: var(--muted-foreground, #64748b); }
.kt-alert { font-size: .875rem; }
.login-label-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.login-forgot { font-size: .8125rem; }
.login-back { display: inline-flex; align-items: center; gap: .4rem; font-size: .875rem; align-self: center; }
.login-success {
    display: flex; gap: .5rem; align-items: flex-start; padding: .75rem 1rem; border-radius: .5rem; font-size: .875rem;
    color: #166534; background: rgba(34, 197, 94, .14); border: 1px solid rgba(34, 197, 94, .35);
}
.dark .login-success { color: #86efac; }

/* ---------- Desktop: image left, login right ---------- */
@media (min-width: 1024px) {
    .login-shell { grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr); grid-template-rows: 1fr; }
    .login-hero { min-height: 100vh; }
    .hero-content {
        position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
        padding: 3rem 3.5rem; color: #fff;
    }
    .hero-badge {
        align-self: flex-start; display: inline-flex; align-items: center; gap: .5rem;
        padding: .45rem .9rem; border-radius: 999px; font-size: .8rem; font-weight: 500;
        background: rgba(255, 255, 255, .14); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .25);
    }
    .hero-content h2 { margin: 0 0 .75rem; font-size: 2.5rem; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
    .hero-content p { margin: 0; max-width: 34rem; font-size: 1.05rem; line-height: 1.55; color: rgba(255, 255, 255, .88); }
    .hero-content small { display: block; margin-top: 2rem; color: rgba(255, 255, 255, .7); }
    .hero-content h2, .hero-content p { text-shadow: 0 1px 12px rgba(0, 0, 0, .45); }
    .login-panel { padding: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide { animation: none; }
    .hero-slide:first-child { opacity: 1; }
}
.login-forgot { white-space: nowrap; }

.login-theme { position: absolute; top: 1rem; right: 1rem; }

.login-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.25rem; }
.login-brand img { width: 44px; height: 44px; }
.login-brand-text { font-size: 1.5rem; letter-spacing: -.01em; color: var(--foreground, #0f172a); }

/* error / status pages */
.error-code { margin: 0 0 .25rem; font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary, #1b66ff); }
.error-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.error-ref { margin-top: 1.25rem; word-break: break-all; }

/* the failed-sign-in banner: the same soft tint the rest of the portal uses for errors */
.kt-alert.kt-alert-destructive { display: block; padding: .7rem .9rem; margin-bottom: 1rem; border-radius: .5rem; color: #b91c1c; background: rgba(220, 38, 38, .08); border: 1px solid rgba(220, 38, 38, .3); }
.dark .kt-alert.kt-alert-destructive { color: #fca5a5; background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .35); }
