:root {
  --bg: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #cbd5e1;
  --accent: #0ea5e9;
  --accent-ink: #0369a1;
  --danger-bg: #fef2f2;
  --danger: #b91c1c;
  --dark: #0f172a;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.layout { display: grid; min-height: 100%; grid-template-columns: minmax(0, 1fr); }

.brand {
  display: none;
  background:
    radial-gradient(60rem 30rem at 0% 0%, rgba(14, 165, 233, 0.18), transparent 60%),
    var(--dark);
  color: #e2e8f0;
  padding: 3rem;
  flex-direction: column;
  justify-content: space-between;
}
.brand-inner { margin-top: auto; margin-bottom: auto; max-width: 26rem; }
.brand h1 { margin: 1.5rem 0 0.5rem; font-size: 2rem; font-weight: 650; letter-spacing: -0.02em; color: #fff; }
.brand p { margin: 0; color: #94a3b8; font-size: 1.05rem; }
.brand .brand-foot { font-size: 0.8rem; color: #64748b; }

.mark {
  display: grid; place-items: center;
  width: 3rem; height: 3rem; border-radius: 0.75rem;
  background: var(--accent); color: #fff; font-weight: 700; letter-spacing: -0.02em; font-size: 1.05rem;
}
.mark.small { width: 2.25rem; height: 2.25rem; border-radius: 0.6rem; font-size: 0.85rem; }

.panel { display: grid; place-items: center; padding: 1.5rem 1rem; }
.card { width: 100%; max-width: 24rem; }

.mobile-brand { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 2rem; font-weight: 600; letter-spacing: -0.01em; }

h2 { margin: 0; font-size: 1.6rem; font-weight: 650; letter-spacing: -0.02em; }
.lead { margin: 0.4rem 0 1.75rem; color: var(--muted); }

.field { margin-bottom: 1.1rem; }
label { display: block; margin-bottom: 0.4rem; font-size: 0.85rem; font-weight: 600; color: #334155; }

input {
  width: 100%;
  height: 2.9rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18); }
input[aria-invalid="true"] { border-color: #ef4444; }

.pw { position: relative; }
.pw input { padding-right: 5.2rem; }
.ghost {
  position: absolute; top: 50%; right: 0.35rem; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--accent-ink);
  font: inherit; font-size: 0.8rem; font-weight: 600; padding: 0.4rem 0.6rem; border-radius: 0.45rem; cursor: pointer;
}
.ghost:hover { background: #f0f9ff; }

.error {
  margin: 0 0 1rem; padding: 0.7rem 0.9rem;
  border-radius: 0.6rem; background: var(--danger-bg); color: var(--danger); font-size: 0.88rem;
}

.primary {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; height: 2.9rem;
  border: 0; border-radius: 0.65rem;
  background: var(--dark); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.primary:hover { background: #1e293b; }
.primary:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.35); }
.primary:disabled { opacity: 0.75; cursor: progress; }

.spinner {
  display: none; width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.note { margin: 1.5rem 0 0; font-size: 0.82rem; color: var(--muted); text-align: center; }

@media (min-width: 64rem) {
  .layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .brand { display: flex; }
  .mobile-brand { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
  * { transition: none !important; }
}
