:root {
  --navy: #06091a;
  --navy-2: #0c1230;
  --gold: #d4a72c;
  --gold-2: #f3c84b;
  --ink: #e9eaf0;
  --muted: #8a8fa6;
  --line: #1b2147;
  --error: #ff6b6b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at 30% 10%, #0c1338 0%, var(--navy) 60%);
  color: var(--ink);
  min-height: 100vh;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 18px;
  letter-spacing: 0.5px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: rgba(12, 18, 48, 0.85);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}

.card.wide { max-width: 720px; }

.enroll-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  margin: 24px 0;
  align-items: start;
}
@media (max-width: 560px) {
  .enroll-grid { grid-template-columns: 1fr; }
}
.qr {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  justify-content: center;
}
.qr img { width: 100%; height: auto; display: block; }
.enroll-instructions ol { margin: 0; padding-left: 20px; line-height: 1.7; }
.enroll-instructions ol li { font-size: 14px; }
.enroll-instructions details { margin-top: 14px; font-size: 13px; color: var(--muted); }
.enroll-instructions .secret {
  background: rgba(0,0,0,0.3);
  padding: 8px 10px;
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 1px;
  word-break: break-all;
}

h1 {
  margin: 0 0 4px 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px 0;
}

.error {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: var(--error);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

form label {
  display: block;
  margin-bottom: 14px;
}

form label span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 4px;
}

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
}

input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--gold);
}

button {
  width: 100%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  color: var(--navy);
  font-weight: 700;
  padding: 13px;
  border-radius: 8px;
  border: none;
  font-size: 15px;
  cursor: pointer;
  margin-top: 8px;
  letter-spacing: 0.3px;
}

button:hover { filter: brightness(1.05); }

.footnote {
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Portal */
body.portal {
  align-items: flex-start;
  padding: 32px 24px 60px;
  flex-direction: column;
}

body.portal header {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.portal header .brand { margin: 0; }
body.portal .who { font-size: 13px; color: var(--muted); }
body.portal .who a { color: var(--gold); text-decoration: none; }
body.portal main { width: 100%; max-width: 1100px; margin: 0 auto; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.tile {
  background: rgba(12, 18, 48, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  color: var(--ink);
  text-decoration: none;
  display: block;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.tile:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}

.tile.disabled { opacity: 0.5; pointer-events: none; }

.tile-name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  margin-bottom: 6px;
}

.tile-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }
