﻿/* =====================================================================
   Torn API Key Portal — stylesheet
   Palette: dark (#0f1117), card (#1a1e2e), accent blue (#4a9eff),
            accent orange (#ff8c42), text white/grey
   ===================================================================== */

:root {
  --bg: #0f1117;
  --bg-card: #1a1e2e;
  --bg-card-hover: #1f2438;
  --border: #2e3450;
  --accent: #4a9eff;
  --accent-hover: #3a8eef;
  --accent-orange: #ff8c42;
  --danger: #e85555;
  --success: #44c96e;
  --text: #e8eaf0;
  --text-muted: #8892a4;
  --radius: 10px;
  --transition: 0.2s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout ---- */
.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =====================================================================
   HEADER
   ===================================================================== */
header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.logo-icon { font-size: 1.3rem; }

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition);
}

nav a:hover { color: var(--accent); text-decoration: none; }

/* =====================================================================
   HERO
   ===================================================================== */
.hero {
  padding: 4.2rem 0 3.2rem;
  text-align: center;
  background: linear-gradient(180deg, #141829 0%, var(--bg) 100%);
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

.hero-rewards {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-reward-pill {
  min-width: 220px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(74, 158, 255, 0.24);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.hero-reward-pill strong {
  color: var(--text);
  font-size: 0.98rem;
}

.hero-reward-label {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* =====================================================================
   HOW IT WORKS
   ===================================================================== */
.how-it-works {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
}

.how-it-works h2 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--text);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: border-color var(--transition);
}

.step:hover { border-color: var(--accent); }

.step-num {
  width: 2.4rem;
  height: 2.4rem;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.step h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.step p { color: var(--text-muted); font-size: 0.88rem; }

/* =====================================================================
   DISCLOSURE
   ===================================================================== */
.disclosure-section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
}

.section-heading {
  margin-bottom: 1.35rem;
}

.section-heading h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.section-heading p {
  color: var(--text-muted);
  max-width: 760px;
}

/* =====================================================================
   TERMS OF SERVICE
   ===================================================================== */
.terms-section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
}

.terms-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.2rem;
}

.terms-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.terms-box:focus { outline: 2px solid var(--accent); }

.terms-box h3 {
  font-size: 0.95rem;
  color: var(--text);
  margin: 1.2rem 0 0.4rem;
}

.terms-box h3:first-child { margin-top: 0; }

.terms-box p, .terms-box ul { margin-bottom: 0.6rem; line-height: 1.6; }

.terms-box ul { padding-left: 1.4rem; }

.terms-box ul li { margin-bottom: 0.3rem; }

.terms-box blockquote {
  margin: 0.85rem 0 1rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--accent);
  background: rgba(74, 158, 255, 0.08);
  border-radius: 0 10px 10px 0;
}

.terms-box blockquote p {
  margin-bottom: 0;
  color: var(--text);
}

.terms-box blockquote footer {
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.terms-box strong {
  color: var(--text);
}

.tos-table-wrapper {
  border: 1px solid #39415d;
  border-radius: 12px;
  overflow-x: auto;
  margin: 0;
  background: linear-gradient(180deg, #1c2236 0%, #141927 100%);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
}

.tos-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  background: transparent;
}

.tos-table th,
.tos-table td {
  border: 1px solid #3a425f;
  padding: 0.85rem 0.9rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

.tos-table th {
  background: #29324d;
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tos-table td {
  color: #c8d0df;
  font-size: 0.85rem;
  background: rgba(18, 22, 34, 0.86);
}

.read-sentinel {
  width: 100%;
  height: 2px;
}

.scroll-hint {
  font-size: 0.82rem;
  color: var(--accent-orange);
  margin-top: 0.6rem;
  text-align: center;
  transition: opacity 0.4s;
}

.scroll-hint.hidden { opacity: 0; pointer-events: none; }

/* =====================================================================
   SUBMISSION FORM
   ===================================================================== */
.submit-section {
  padding: 3.5rem 0 5rem;
  border-top: 1px solid var(--border);
}

.submit-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Labels */
label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* Input */
.input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

input[type="text"], input[type="password"] {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  font-size: 1rem;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.08em;
  outline: none;
  transition: border-color var(--transition);
}

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

input::placeholder { color: var(--text-muted); letter-spacing: normal; }

.btn-icon {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color var(--transition), color var(--transition);
}

.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

.field-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

/* Buttons */
.btn {
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:not(:disabled):hover { background: var(--accent-hover); }

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

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-row {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

/* Alerts */
.alert {
  border-radius: 6px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  margin-top: 1rem;
}

.alert-error {
  background: rgba(232, 85, 85, 0.12);
  border: 1px solid rgba(232, 85, 85, 0.4);
  color: #f18080;
}

.alert-success {
  background: rgba(68, 201, 110, 0.12);
  border: 1px solid rgba(68, 201, 110, 0.4);
  color: #7de09e;
}

/* Confirmation box */
.confirm-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.4rem;
}

.confirm-box p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.player-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
}

.player-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ToS checkbox */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.checkbox-label:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }

/* Success state */
.success-box {
  text-align: center;
  padding: 1rem 0;
}

.success-icon { font-size: 2.5rem; margin-bottom: 0.8rem; }

.success-box h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--success);
}

.success-box p { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 0.3rem; }

.success-sub { font-size: 0.85rem; }

/* Loading overlay */
.loading {
  position: absolute;
  inset: 0;
  background: rgba(26, 30, 46, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-radius: var(--radius);
  z-index: 10;
}

.loading p { color: var(--text-muted); font-size: 0.9rem; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Hidden utility */
.hidden { display: none !important; }

/* =====================================================================
   FOOTER
   ===================================================================== */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 1.5rem 0;
  text-align: center;
}

footer p {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 520px) {
  .hero { padding: 3rem 0 2.5rem; }
  .card { padding: 1.4rem; }
  .btn-row { flex-direction: column; }
  nav { gap: 1rem; }
  .hero-reward-pill { min-width: 100%; border-radius: 18px; }
  .tos-table { min-width: 780px; }
}
