*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #0f172a;
    background: #f5f6f8;
}

/* Two-column layout */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ─── LEFT: Aetopia brand panel ─────────────────────────────────────── */
.panel {
    display: flex;
    flex-direction: column;
    padding: 36px 56px;
    background: #0c2724 url('/images/auth-background.svg') center center / cover no-repeat;
    color: #e2e8f0;
    position: relative;
    overflow: hidden;
}

.panel-header { color: #fff; }

.lockup {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    height: 44px;
    color: #fff;
}
.lockup-symbol {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}
.lockup-wordmark {
    font-size: 1.9rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: #fff;
    line-height: 1;
}

.panel-hero {
    margin: auto 0;
    max-width: 480px;
}
.panel-headline {
    font-size: 2.6rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.035em;
    line-height: 1.1;
    margin: 0 0 14px;
}
.panel-sub {
    font-size: 1.05rem;
    line-height: 1.55;
    color: #cbd5e1;
    margin: 0;
}

.form-footer {
    position: absolute;
    bottom: 20px;
    right: 32px;
    font-size: 0.75rem;
    color: #475569;
    letter-spacing: 0.04em;
    font-weight: 500;
}

/* ─── RIGHT: form area ──────────────────────────────────────────────── */
.form-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}
.form-inner {
    width: 100%;
    max-width: 360px;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.025em;
    margin-bottom: 24px;
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.84rem;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.form-group input:focus {
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.login-actions { margin-top: 24px; }

.btn-sign-in {
    width: 100%;
    padding: 12px 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    background: #0f172a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    letter-spacing: -0.005em;
}

.btn-sign-in:hover { background: #1e293b; }

/* Signed in state */
.login-success { text-align: center; padding: 20px 0; }
.check-mark { font-size: 2rem; color: #14b8a6; font-style: normal; }
.login-success p { margin-top: 12px; font-size: 0.9rem; color: #334155; }
.login-success-hint { font-size: 0.82rem !important; color: #64748b !important; }

/* SSO */
.sso-section { margin-bottom: 4px; }

.btn-sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    background: #fff;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.btn-sso:hover { background: #f8fafc; border-color: #94a3b8; }

.sso-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 12px;
}

.sso-divider::before,
.sso-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e4e4e7;
}

.sso-divider span {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 880px) {
    .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .panel { min-height: 220px; padding: 28px 32px; }
    .panel-headline { font-size: 1.8rem; }
    .panel-sub { font-size: 0.95rem; }
}
