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

:root {
    --dark:       #0d1117;
    --dark-2:     #161b22;
    --dark-3:     #21262d;
    --accent:     #2563eb;
    --accent-hi:  #3b82f6;
    --accent-dim: rgba(37, 99, 235, 0.12);
    --ink-inv:    #e6edf3;
    --ink-inv-2:  #8b949e;
    --form-ink:   #111318;
    --form-ink-2: #3d4250;
    --form-ink-3: #6b7280;
    --border:     #e2e5ea;
    --surface:    #ffffff;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body {
    height: 100%;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────── */

.screen {
    display: grid;
    grid-template-columns: 45fr 55fr;
    min-height: 100vh;
}

/* ── Left panel ─────────────────────────────────── */

.panel-brand {
    background-color: var(--dark);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(37,99,235,.18) 0%, transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(37,99,235,.10) 0%, transparent 50%),
        radial-gradient(circle, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: auto, auto, 28px 28px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 52px;
    overflow: hidden;
}

.panel-brand::before {
    content: '';
    position: absolute;
    right: -120px;
    top: 50%;
    transform: translateY(-50%);
    width: 380px;
    height: 380px;
    border-radius: 50%;
    border: 1px solid rgba(37,99,235,.2);
    pointer-events: none;
}

.panel-brand::after {
    content: '';
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 1px solid rgba(37,99,235,.12);
    pointer-events: none;
}

.brand-top { position: relative; z-index: 1; }

.brand-logo--login {
    display: block;
    width: min(100%, 280px);
    height: auto;
    max-height: 120px;
    object-fit: contain;
}

.brand-logo--portal-login {
    display: block;
    width: 20%;
    min-width: 140px;
    max-width: 260px;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
}

.brand-wordmark--login {
    gap: 12px;
}

.brand-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-icon svg { display: block; }

.brand-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink-inv);
    letter-spacing: -0.02em;
}

.brand-body {
    position: relative;
    z-index: 1;
}

.brand-footer {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: var(--ink-inv-2);
}

/* ── Right panel ─────────────────────────────────── */

.panel-form {
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
}

.form-box {
    width: 100%;
    max-width: 380px;
    animation: fadeUp .4s ease both;
}

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

@media (prefers-reduced-motion: reduce) {
    .form-box { animation: none; }
}

.form-heading {
    font-size: 22px;
    font-weight: 700;
    color: var(--form-ink);
    letter-spacing: -0.025em;
    margin-bottom: 6px;
}

.form-sub {
    font-size: 14px;
    color: var(--form-ink-3);
    margin-bottom: 32px;
    line-height: 1.5;
}

.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--form-ink-2);
    margin-bottom: 6px;
}

.input-wrap { position: relative; }

.input-wrap svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--form-ink-3);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--form-ink);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

.input-wrap input::placeholder { color: #b0b7c3; }

.input-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.btn-submit {
    width: 100%;
    margin-top: 8px;
    padding: 10px 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    letter-spacing: -0.01em;
    transition: background .15s, transform .1s;
}

.btn-submit:hover  { background: #1d4ed8; }
.btn-submit:active { transform: scale(.99); }

.form-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 12.5px;
    color: var(--form-ink-3);
}

.form-footer a {
    color: var(--accent);
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* ── Responsive ─────────────────────────────────── */

@media (max-width: 768px) {
    .screen {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .panel-brand {
        padding: 20px 24px;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
    }

    .brand-logo--portal-login {
        width: auto;
        max-width: 160px;
        max-height: 56px;
        border-radius: 12px;
    }

    .brand-logo--login {
        width: auto;
        max-width: 180px;
        max-height: 48px;
    }

    .brand-wordmark--login .brand-text {
        font-size: 18px;
    }

    .brand-wordmark--login .brand-icon-s {
        width: 36px;
        height: 36px;
    }

    .panel-brand::before,
    .panel-brand::after { display: none; }

    .brand-body,
    .brand-footer { display: none; }

    .brand-top { margin-bottom: 0; }

    .panel-form {
        padding: 40px 24px;
        justify-content: flex-start;
    }
}
