:root {
    --ink: #14213d;
    --ink-soft: #55607a;
    --paper: #f3f5fa;
    --white: #ffffff;
    --line: #dfe4ee;
    --accent: #3a5bff;
    --accent-dark: #2742d6;
    --ok: #12a37a;
    --danger: #c8352f;
    --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(58, 91, 255, .45); outline-offset: 2px; }

/* ---------- Auth pages ---------- */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }

.auth-brand {
    position: relative; overflow: hidden;
    background: var(--ink); color: #fff;
    padding: 48px 56px;
    display: flex; flex-direction: column; justify-content: space-between;
}
.auth-brand::before, .auth-brand::after {
    content: ""; position: absolute; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .10);
}
.auth-brand::before { width: 640px; height: 640px; right: -260px; bottom: -280px; }
.auth-brand::after  { width: 380px; height: 380px; right: -90px;  bottom: -110px; border-color: var(--accent); border-width: 3px; }
.logo { font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; font-size: .95rem; }
.auth-brand h2 { font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 14px; max-width: 14ch; position: relative; z-index: 1; }
.auth-brand p { color: #b6c0da; max-width: 36ch; margin: 0; position: relative; z-index: 1; }

.auth-form-wrap { display: grid; place-items: center; padding: 40px 24px; background: var(--white); }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 1.9rem; letter-spacing: -.03em; margin: 0 0 6px; }
.auth-form .sub { color: var(--ink-soft); margin: 0 0 28px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; }
.input-wrap { position: relative; }
.field input {
    width: 100%; padding: 13px 14px; font: inherit; color: var(--ink);
    background: var(--paper); border: 1.5px solid transparent; border-radius: var(--radius);
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.field input:hover { border-color: var(--line); }
.field input:focus { outline: none; background: var(--white); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(58, 91, 255, .14); }
.toggle-pw {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; color: var(--ink-soft); font: inherit; font-size: .8125rem; font-weight: 600;
    padding: 6px 8px; border-radius: 8px; cursor: pointer;
}
.toggle-pw:hover { color: var(--ink); background: var(--line); }
.hint { font-size: .8125rem; color: var(--ink-soft); margin-top: 6px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    font: inherit; font-weight: 700; cursor: pointer; border: 0; border-radius: var(--radius);
    padding: 13px 20px; transition: background .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { width: 100%; background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); padding: 9px 16px; }
.btn-ghost:hover { background: var(--paper); text-decoration: none; }

.notice { padding: 12px 14px; border-radius: var(--radius); font-size: .9rem; margin-bottom: 20px; }
.notice-error { background: #fdeceb; color: var(--danger); }
.notice-ok { background: #e3f6ef; color: #0b7a5b; }
.switch { margin-top: 24px; color: var(--ink-soft); font-size: .9375rem; }

/* ---------- Dashboard ---------- */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1040px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; }
.topbar .logo { color: var(--ink); }
.user-chip { display: flex; align-items: center; gap: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; }

.page { max-width: 1040px; margin: 0 auto; padding: 48px 24px 72px; }
.page h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); letter-spacing: -.03em; line-height: 1.15; margin: 0 0 8px; }
.page .lead { color: var(--ink-soft); margin: 0 0 36px; }

.grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 24px; align-items: start; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.panel h2 { font-size: 1.05rem; margin: 0 0 18px; letter-spacing: -.01em; }
.panel-accent { background: var(--ink); border-color: var(--ink); color: #fff; }
.panel-accent .row dt { color: #9aa7c7; }
.panel-accent .row { border-color: rgba(255, 255, 255, .12); }

.row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; padding-top: 0; }
.row dt { color: var(--ink-soft); }
.row dd { margin: 0; font-weight: 600; text-align: right; }
dl { margin: 0; }
.status { display: inline-flex; align-items: center; gap: 8px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.todo li:first-child { border-top: 0; padding-top: 0; }
.check { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); margin-top: 2px; }
.check.done { background: var(--ok); border-color: var(--ok); position: relative; }
.check.done::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.todo strong { display: block; }
.todo span { color: var(--ink-soft); font-size: .9rem; }

@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { padding: 28px 24px 36px; min-height: 0; gap: 28px; }
    .auth-brand::before, .auth-brand::after { display: none; }
    .auth-brand h2 { font-size: 1.8rem; }
    .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
