/* ========== Base / Reset ========== */
:root {
  --bg: #0d0d0d;
  --card: #1a1a1a;
  --input: #262626;
  --text: #f1f1f1;
  --muted: #ccc;
  --accent: #7a5cff;
  --grad-start: #7a5cff;
  --grad-end: #5ce1e6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh; /* mobile toolbar-safe */
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ========== Card Layout ========== */
.login-container {
  width: calc(100% - 32px);
  max-width: 360px;
  margin: 8vh auto;
  padding: 24px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 0 30px rgba(0,0,0,.6);
  text-align: center;
}

h2 {
  margin: 0 0 1.25rem;
  font-weight: 600;
  font-size: 1.5rem;
  color: #fff;
}

/* ========== Form ========== */
form { text-align: left; }

label {
  display: block;
  margin: .5rem 0 .25rem;
  font-size: .95rem;
  color: var(--muted);
}

input {
  width: 100%;
  padding: .875rem;
  margin-bottom: 1rem;
  border: 0;
  border-radius: 10px;
  background: var(--input);
  color: #fff;
  font-size: 16px;      /* prevents iOS zoom */
  line-height: 1.2;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: #1f1f1f;
}

/* ========== Button & Links ========== */
button {
  width: 100%;
  min-height: 48px;     /* touch target */
  padding: .75rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
}

button:hover { opacity: .9; transform: translateY(-2px); }

.register-link {
  display: block;
  margin-top: 1rem;
  text-align: center;
  color: var(--accent);
  font-size: .95rem;
  text-decoration: none;
}
.register-link:hover { text-decoration: underline; }

/* ========== Messages ========== */
.success { color: #4ade80; margin-bottom: .75rem; }
.error   { color: #f87171; margin-bottom: .75rem; }

/* ========== Preferences / Motion ========== */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ========== Small Screens ========== */
@media (max-width: 480px) {
  h2 { font-size: 1.25rem; margin-bottom: 1rem; }
  .login-container { margin: 6vh auto; padding: 20px; }
}

/* ===== Terms row (register) ===== */
.terms-row {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: .25rem 0 1rem; /* sits tighter with inputs */
  padding: .6rem .75rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  font-size: .95rem;
  line-height: 1.35;
}

/* Native checkbox, but themed */
.terms-row input[type="checkbox"] {
  margin-top: .15rem;           /* align with first line of label */
  width: 18px;
  height: 18px;
  accent-color: var(--accent);  /* modern browsers */
  flex-shrink: 0;
}

/* Label & link look */
.terms-row label {
  margin: 0;                    /* override default label spacing */
  color: var(--text);
  cursor: pointer;
}
.terms-row a {
  color: var(--accent);
  text-decoration: underline;
}
.terms-row a:hover { opacity: .9; }

/* Disabled button state to “lock” visually */
button[disabled] {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;              /* prevent hover lift while disabled */
}