@import url('https://fonts.googleapis.com/css2?family=Urbanist:wght@700;800;900&family=JetBrains+Mono:wght@300;400;500;600;700&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary:   #0a0c10;
  --bg-secondary: #12151c;
  --bg-tertiary:  #1a1e28;
  --bg-input:     #0e1018;
  --border:       #2a2f3a;
  --border-focus: #888c96;
  --text-primary: #e8eaf0;
  --text-secondary:#b0b7c8;
  --text-muted:   #555c6e;
  --accent:       #c8cad0;
  --accent-dim:   #3a3d45;
  --danger:       #ff4a4a;
  --success:      #4aff8b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ── Card ── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
}

.card-logo {
  font-family: 'Urbanist', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 28px;
  text-align: center;
}

.card-logo span { color: var(--text-muted); font-weight: 400; }

.card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
  text-align: center;
}

.card-sub {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

/* ── Form elements ── */
.field { margin-bottom: 18px; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

input[type=text],
input[type=email],
input[type=password] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
}

input:focus { border-color: var(--border-focus); }

/* ── Password reveal ── */
.input-reveal {
  position: relative;
}
.input-reveal input {
  padding-right: 38px;
}
.reveal-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  padding: 0;
}
.reveal-btn:hover { color: var(--text-secondary); }

/* ── Buttons ── */
.btn {
  display: block;
  width: 100%;
  padding: 10px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #0a0c10;
}
.btn-primary:hover  { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── Divider ── */
.divider {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin: 20px 0;
  position: relative;
}
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--border);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

/* ── Status messages ── */
.msg {
  font-size: 13px;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 16px;
  display: none;
}
.msg.error   { background: rgba(255,74,74,0.12); border: 1px solid rgba(255,74,74,0.3); color: var(--danger); }
.msg.success { background: rgba(74,255,139,0.1);  border: 1px solid rgba(74,255,139,0.3); color: var(--success); }
.msg.show    { display: block; }

/* ── Footer link ── */
.footer-link {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 20px;
}
.footer-link a { color: var(--accent); text-decoration: none; }
.footer-link a:hover { text-decoration: underline; }

/* ── Modal overlay (for login modal on index page) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  color: var(--text-muted); font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

@media (max-width: 480px) {
  .card { padding: 28px 20px; border-radius: 6px; }
  .card-title { font-size: 18px; }
  .card-sub { font-size: 14px; }
  label { font-size: 13px; }
  input[type=text],
  input[type=email],
  input[type=password] { font-size: 16px; padding: 11px 12px; } /* 16px prevents iOS zoom */
  .btn { font-size: 16px; padding: 12px; }
  .footer-link { font-size: 14px; }
  .msg { font-size: 14px; }
}
