/* ================================
   LOGIN PAGE — scoped redesign
================================ */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&display=swap");

:root {
    --login-ink: #0f1c2e;
    --login-muted: #5b6b7c;
    --login-line: #d7e0ea;
    --login-surface: #f7fafc;
    --login-panel: #ffffff;
    --login-accent: #0e7490;
    --login-accent-deep: #0a5c70;
    --login-amber: #c9852c;
    --login-success-bg: #ecfdf5;
    --login-success-text: #065f46;
    --login-error-bg: #fef2f2;
    --login-error-text: #991b1b;
    --login-warn-bg: #fffbeb;
    --login-warn-text: #92400e;
}

* {
    box-sizing: border-box;
}

html,
body.login-body {
    margin: 0;
    min-height: 100%;
}

body.login-body {
    font-family: "Manrope", sans-serif;
    color: var(--login-ink);
    background: #0b1724;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
}

/* ---- Left: full-bleed visual ---- */

.login-hero {
    position: relative;
    overflow: hidden;
    color: #f8fafc;
    background:
        linear-gradient(115deg, rgba(8, 24, 38, 0.78) 12%, rgba(14, 116, 144, 0.42) 58%, rgba(15, 28, 46, 0.72) 100%),
        url("../images/login-bg.jpg") center / cover no-repeat;
    padding: clamp(32px, 5vw, 64px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: loginFade 700ms ease both;
}

.login-hero::after {
    content: "";
    position: absolute;
    inset: auto -10% -18% 18%;
    height: 42%;
    background: radial-gradient(circle at center, rgba(201, 133, 44, 0.28), transparent 68%);
    pointer-events: none;
    animation: loginGlow 4.5s ease-in-out infinite alternate;
}

.login-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-brand img {
    height: 52px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

.login-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.login-brand-name {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.15;
}

.login-brand-sub {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.78);
}

.login-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 34rem;
    margin-top: auto;
    margin-bottom: auto;
    animation: loginRise 800ms 120ms ease both;
}

.login-hero-copy h1 {
    margin: 0 0 14px;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.login-hero-copy p {
    margin: 0;
    max-width: 28rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(248, 250, 252, 0.86);
}

.login-hero-foot {
    position: relative;
    z-index: 1;
    font-size: 0.82rem;
    color: rgba(248, 250, 252, 0.7);
}

/* ---- Right: form panel ---- */

.login-panel {
    background: var(--login-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 4vw, 48px);
    animation: loginSlide 650ms 80ms ease both;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.login-card h2 {
    margin: 0 0 8px;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-card .lede {
    margin: 0 0 26px;
    color: var(--login-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.login-card label {
    display: block;
    margin-top: 16px;
    margin-bottom: 7px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--login-ink);
}

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--login-line);
    border-radius: 10px;
    background: #fff;
    color: var(--login-ink);
    font: inherit;
    font-size: 0.95rem;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.login-card input:focus {
    outline: none;
    border-color: var(--login-accent);
    box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.16);
}

.login-card input[readonly] {
    background: #eef3f7;
    color: var(--login-muted);
}

.btn-primary {
    width: 100%;
    margin-top: 22px;
    padding: 13px 16px;
    border: none;
    border-radius: 10px;
    background: var(--login-accent);
    color: #fff;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 180ms ease, transform 180ms ease;
}

.btn-primary:hover {
    background: var(--login-accent-deep);
}

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

.auth-links {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.secondary-btn {
    display: block;
    text-align: center;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--login-line);
    background: #fff;
    color: var(--login-ink);
    font-weight: 700;
    text-decoration: none;
    transition: background 180ms ease, border-color 180ms ease;
}

.secondary-btn:hover {
    background: #eef5f8;
    border-color: #b7c9d6;
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0 auto;
    color: var(--login-accent-deep);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.link-btn:hover {
    color: var(--login-ink);
}

.alert {
    padding: 11px 13px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
}

.alert-success {
    background: var(--login-success-bg);
    color: var(--login-success-text);
}

.alert-error {
    background: var(--login-error-bg);
    color: var(--login-error-text);
}

.alert-warn {
    background: var(--login-warn-bg);
    color: var(--login-warn-text);
}

.forgot-panel {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--login-line);
}

.forgot-panel h3 {
    margin: 0 0 6px;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
}

.forgot-panel .hint {
    margin: 0 0 12px;
    color: var(--login-muted);
    font-size: 0.88rem;
}

@keyframes loginFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes loginRise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loginSlide {
    from {
        opacity: 0;
        transform: translateX(18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes loginGlow {
    from { opacity: 0.55; transform: translateY(0); }
    to { opacity: 1; transform: translateY(-10px); }
}

@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-hero {
        min-height: 34vh;
        padding: 28px 24px;
    }

    .login-hero-copy h1 {
        font-size: 2rem;
    }

    .login-hero-foot {
        display: none;
    }

    .login-panel {
        padding: 28px 22px 40px;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-hero,
    .login-hero-copy,
    .login-panel,
    .login-hero::after {
        animation: none;
    }
}
