:root {
    --navy-900: #0a1f3d;
    --navy-800: #123566;
    --navy-700: #1c4a8c;
    --gold: #d9a92b;
    --gold-bright: #f0c34e;
    --text: #1a2233;
    --muted: #7a8296;
    --error: #c0392b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Sarabun', sans-serif;
    color: var(--text);
}

.portal {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}

/* ---------- Hero (building photo) ---------- */
.hero {
    position: relative;
    background-color: var(--navy-900);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.hero-overlay {
    width: 100%;
    padding: 48px 44px;
    background: linear-gradient(180deg, rgba(10,31,61,0.15) 0%, rgba(10,31,61,0.55) 55%, rgba(10,31,61,0.92) 100%);
    color: #fff;
}

.hero-emblem {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 2px solid var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin-bottom: 18px;
    overflow: hidden;
}
.hero-emblem img { width: 100%; height: 100%; object-fit: cover; }

.hero h2 {
    font-family: 'Kanit', sans-serif;
    font-size: 26px;
    line-height: 1.35;
    margin: 0 0 8px;
}

.hero p {
    margin: 0;
    font-size: 14px;
    color: rgba(255,255,255,0.75);
}

/* ---------- Form side ---------- */
.form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: #f4f6fa;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 16px;
    padding: 32px 30px;
    box-shadow: 0 12px 34px rgba(10,31,61,0.10);
    border-top: 4px solid var(--gold);
}

.mobile-emblem { display: none; }

.brand h1 {
    font-family: 'Kanit', sans-serif;
    font-size: 20px;
    margin: 0 0 4px;
    color: var(--navy-900);
}

.brand p {
    margin: 0 0 22px;
    font-size: 13px;
    color: var(--muted);
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 16px 0 6px;
}

input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dfe3ea;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
}

input:focus {
    outline: none;
    border-color: var(--navy-700);
    box-shadow: 0 0 0 3px rgba(28,74,140,0.14);
}

button {
    width: 100%;
    margin-top: 24px;
    padding: 13px;
    border: none;
    border-radius: 8px;
    background: var(--gold);
    color: var(--navy-900);
    font-family: 'Kanit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}
button:hover { background: var(--gold-bright); }

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 8px;
}
.alert-error {
    background: #fdecea;
    color: var(--error);
    border: 1px solid #f5c2c2;
}

.hint {
    margin-top: 20px;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    line-height: 1.6;
}

/* ---------- Responsive: stack on mobile, hide hero photo panel ---------- */
@media (max-width: 860px) {
    .portal { grid-template-columns: 1fr; }
    .hero { display: none; }
    .form-side { min-height: 100vh; padding: 20px; }
    .mobile-emblem {
        display: flex;
        width: 56px; height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
        border: 2px solid var(--gold);
        align-items: center; justify-content: center;
        font-size: 24px;
        color: #fff;
        margin: 0 auto 16px;
        overflow: hidden;
    }
    .mobile-emblem img { width: 100%; height: 100%; object-fit: cover; }
}
