:root {
  --bg: #0f172a;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2f5bea;
  --accent-dark: #2547c4;
  --error: #b42318;
  --error-bg: #fef3f2;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.hero {
  position: relative;
  overflow: hidden;
  color: #e2e8f0;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(47, 91, 234, .55), transparent 60%),
    radial-gradient(900px 500px at 120% 120%, rgba(14, 165, 233, .35), transparent 60%),
    linear-gradient(160deg, #0f172a 0%, #111c3a 100%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 85%);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 17px; position: relative; z-index: 1; }
.brand svg { flex: none; }
.hero h1 { font-size: 40px; line-height: 1.15; margin: 0 0 16px; color: #fff; letter-spacing: -.02em; }
.hero p { margin: 0; max-width: 460px; color: #a5b4cf; font-size: 16px; }
.hero-body { position: relative; z-index: 1; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 40px; max-width: 520px; }
.tile {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  color: #cbd5e1;
  backdrop-filter: blur(4px);
}
.tile b { display: block; color: #fff; font-size: 14px; margin: 8px 0 2px; font-weight: 600; }
.hero-foot { position: relative; z-index: 1; font-size: 13px; color: #64748b; display: flex; gap: 8px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.15); }

.side { background: var(--panel); display: flex; flex-direction: column; justify-content: center; padding: 48px; }
.card { width: 100%; max-width: 380px; margin: 0 auto; }
.card h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.01em; }
.card .sub { margin: 0 0 28px; color: var(--muted); }
label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
input[type=text], input[type=password] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  color: inherit;
  background: #f8fafc;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(47, 91, 234, .12); }
.row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 22px; font-size: 13px; }
.row label { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; color: var(--muted); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
button:active { transform: translateY(1px); }
.primary { background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; gap: 10px; }
.primary:hover { background: var(--accent-dark); }
.primary[disabled] { opacity: .8; cursor: progress; }
.secondary { background: #fff; color: var(--text); border: 1px solid var(--line); margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.secondary:hover { background: #f8fafc; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 20px 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.alert { display: none; margin-bottom: 18px; padding: 12px 14px; border-radius: 10px; font-size: 13px; background: var(--error-bg); color: var(--error); border: 1px solid #fecdca; }
.alert.show { display: block; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: none; }
.primary[disabled] .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.legal { margin-top: 28px; font-size: 12px; color: var(--muted); text-align: center; }
.legal a { color: var(--muted); }

@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 28px; }
  .tiles, .hero-foot { display: none; }
  .side { padding: 32px 24px 48px; justify-content: flex-start; }
}
