* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--bg-body); color: var(--text-primary); font-family: var(--font); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
svg { width: 1.25rem; height: 1.25rem; stroke-width: 1.7; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(33rem, 48%) minmax(32rem, 52%); }
.intro-panel { min-height: 100vh; padding: 3.5rem 3.75rem 2.75rem; display: flex; flex-direction: column; overflow: hidden; background: var(--intro-bg); border-right: 1px solid var(--border-color); }
.brand { display: flex; align-items: center; gap: 1rem; }
.brand-mark { position: relative; width: 3rem; height: 3rem; border: 2px solid var(--text-secondary); transform: rotate(30deg); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; inset: .5rem; border: 1px solid var(--primary); }
.brand-mark::after { inset: 1rem -.45rem -.45rem 1rem; border-color: var(--warning); }
.brand-mark i { position: absolute; inset: 50% auto auto 50%; width: .35rem; height: .35rem; border-radius: 50%; background: var(--primary); transform: translate(-50%, -50%); }
.brand-copy { display: flex; flex-direction: column; gap: .25rem; }
.brand-copy strong { font-size: 1.45rem; }
.brand-copy small { color: var(--text-secondary); }
.intro-copy { margin-top: 3.5rem; max-width: 34rem; }
.intro-copy h1 { margin: 0; font-size: 2.55rem; line-height: 1.35; letter-spacing: 0; }
.intro-copy h1 em { color: var(--primary-hover); font-style: normal; }
.intro-copy p { max-width: 31rem; margin: 1.3rem 0 0; color: var(--text-secondary); font-size: 1rem; line-height: 1.8; }

.workspace-visual { position: relative; flex: 1; min-height: 19rem; max-height: 26rem; margin-top: 1rem; }
.code-window, .metric-window, .task-window { position: absolute; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg-panel); box-shadow: var(--shadow); }
.code-window { left: 12%; top: 13%; width: min(19rem, 58%); height: 14rem; }
.window-dots { height: 2.5rem; padding: 0 .9rem; display: flex; align-items: center; gap: .45rem; border-bottom: 1px solid var(--border-color); }
.window-dots i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--text-muted); }
.window-dots i:nth-child(2) { background: var(--warning); }
.window-dots i:nth-child(3) { background: var(--success); }
.code-body { padding: 1.7rem; display: grid; gap: .75rem; }
.code-body span { height: .35rem; border-radius: 1rem; background: var(--primary-soft); }
.code-body span:nth-child(2n) { width: 72%; background: var(--bg-subtle); }
.code-body span:nth-child(3n) { width: 48%; background: var(--warning-soft); }
.metric-window { right: 8%; top: 2%; width: 10rem; height: 7rem; padding: 1rem; display: grid; grid-template-columns: 2rem 1fr; align-items: center; gap: .5rem; }
.metric-window svg { color: var(--success); }
.metric-window strong { font-size: 1.35rem; }
.metric-window span { grid-column: 1 / -1; height: .45rem; border-radius: 1rem; background: var(--success-soft); }
.task-window { right: 5%; top: 45%; width: 11rem; min-height: 7.5rem; padding: 1rem; display: grid; grid-template-columns: 1.4rem 1fr; align-items: center; gap: .8rem; }
.task-window svg { color: var(--primary); }
.task-window span { height: .4rem; border-radius: 1rem; background: var(--bg-subtle); }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: auto; }
.feature-grid article { min-width: 0; text-align: center; }
.feature-grid svg { width: 2rem; height: 2rem; margin-bottom: .7rem; color: var(--text-secondary); }
.feature-grid strong { display: block; font-size: .85rem; }
.feature-grid p { margin: .55rem 0 0; color: var(--text-muted); font-size: .75rem; line-height: 1.55; }
.intro-panel footer { margin-top: 2.5rem; color: var(--text-muted); font-size: .75rem; }

.form-panel { min-height: 100vh; padding: 3rem; display: grid; place-items: center; background: var(--bg-body); }
.form-card { width: min(35rem, 100%); padding: 2rem 2.75rem 3rem; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg-panel); box-shadow: var(--shadow); }
.preference-bar { display: flex; justify-content: flex-end; gap: .6rem; margin-bottom: 2rem; }
.preference-bar label { min-width: 0; height: 2.5rem; padding: 0 .6rem; display: flex; align-items: center; gap: .4rem; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-input); color: var(--text-secondary); }
.preference-bar svg { width: 1rem; height: 1rem; }
.preference-bar select { max-width: 8.5rem; border: 0; background: transparent; color: var(--text-primary); outline: 0; font-size: .78rem; }
.form-heading { margin-bottom: 2rem; text-align: center; }
.form-heading h2 { margin: 0 0 .8rem; font-size: 2rem; letter-spacing: 0; }
.form-heading p { margin: 0; color: var(--text-secondary); }
.form-alert { margin-bottom: 1.1rem; padding: .8rem 1rem; border: 1px solid var(--danger); border-radius: 6px; background: var(--danger-soft); color: var(--danger); font-size: .85rem; }
.field-group { margin-bottom: 1rem; }
.field-group > label { display: block; margin-bottom: .55rem; font-size: .88rem; font-weight: 600; }
.input-wrap { height: 3.6rem; padding: 0 1rem; display: flex; align-items: center; gap: .65rem; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--bg-input); }
.input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-wrap > svg { flex: 0 0 auto; color: var(--text-secondary); }
.input-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text-primary); }
.input-wrap input::placeholder { color: var(--text-muted); }
.icon-button { width: 2.25rem; height: 2.25rem; padding: 0; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--text-secondary); }
.icon-button:hover { background: var(--bg-panel-hover); color: var(--text-primary); }
.error-text { display: block; min-height: 1.25rem; padding-top: .35rem; color: var(--danger); font-size: .72rem; }
.form-options { margin: .4rem 0 1.7rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.remember { display: flex; align-items: center; gap: .65rem; cursor: pointer; }
.remember input { position: absolute; opacity: 0; }
.checkbox-ui { width: 1.15rem; height: 1.15rem; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 3px; }
.remember input:checked + .checkbox-ui { border-color: var(--primary); background: var(--primary); }
.remember input:checked + .checkbox-ui::after { content: "✓"; color: var(--white); font-size: .75rem; }
.remember em { color: var(--text-secondary); font-size: .82rem; font-style: normal; }
.text-button { padding: .25rem; border: 0; background: transparent; color: var(--primary-hover); font-size: .82rem; }
.login-button { width: 100%; height: 3.6rem; border: 0; border-radius: 7px; background: var(--primary); color: var(--white); font-weight: 700; }
.login-button:hover { background: var(--primary-hover); }
.login-button:disabled { cursor: wait; opacity: .65; }
.toast { position: fixed; right: 1.5rem; bottom: 1.5rem; max-width: min(24rem, calc(100% - 3rem)); padding: .8rem 1rem; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--bg-panel); color: var(--text-primary); box-shadow: var(--shadow); opacity: 0; transform: translateY(.75rem); transition: .2s; pointer-events: none; z-index: 100; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1100px) {
    .login-page { grid-template-columns: 44% 56%; }
    .intro-panel { padding: 2.5rem; }
    .intro-copy h1 { font-size: 2.1rem; }
    .workspace-visual { min-height: 16rem; }
    .metric-window { right: 0; }
    .task-window { right: -1rem; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
    .login-page { display: block; }
    .intro-panel { min-height: auto; }
    .workspace-visual { height: 19rem; flex: none; }
    .form-panel { min-height: auto; padding: 3rem 1.5rem; }
}
@media (max-width: 520px) {
    .intro-panel { padding: 2rem 1.25rem; }
    .intro-copy { margin-top: 2.5rem; }
    .intro-copy h1 { font-size: 1.8rem; }
    .workspace-visual { display: none; }
    .feature-grid { margin-top: 3rem; }
    .intro-panel footer { margin-top: 3rem; }
    .form-panel { display: block; padding: 1.25rem .75rem; }
    .form-card { width: 100%; padding: 1.25rem 1.1rem 2rem; }
    .preference-bar { justify-content: stretch; }
    .preference-bar > .locale-picker { flex: 1; }
    .preference-bar label { flex: 1; }
    .form-options { align-items: flex-start; }
}
