/* ============================================================
   ArcheAge Offline — design system
   Dark fantasy: midnight blues + warm gold, clean and modern.
   ============================================================ */

:root {
  --bg:        #0b0f1a;
  --bg-2:      #0f1525;
  --panel:     rgba(255, 255, 255, 0.035);
  --panel-2:   rgba(255, 255, 255, 0.06);
  --border:    rgba(255, 255, 255, 0.09);
  --border-2:  rgba(255, 255, 255, 0.16);

  --text:      #e7eaf2;
  --muted:     #9aa3b8;
  --faint:     #6b7390;

  --gold:      #e8c37e;
  --gold-2:    #f3d79a;
  --gold-deep: #b8893f;
  --teal:      #5fc9c1;

  --ok:        #66cf8a;
  --warn:      #e8c37e;
  --danger:    #ec6b66;
  --danger-2:  #f08a86;

  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  --shadow:    0 10px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 18px rgba(0, 0, 0, 0.35);

  --maxw:      1120px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(232, 195, 126, 0.10), transparent 60%),
    radial-gradient(1000px 620px at 10% 5%, rgba(95, 201, 193, 0.07), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.display { font-family: var(--font-display); letter-spacing: 0.02em; font-weight: 700; }

.muted { color: var(--muted); }
.center { text-align: center; }
.mono { font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace; }

/* ----------------------------------------------------- top nav */
.nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(11, 15, 26, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; gap: 18px;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  color: var(--text); letter-spacing: 0.04em;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--gold), var(--gold-deep));
  color: #1a1206; font-weight: 800; font-family: var(--font-display);
  box-shadow: 0 2px 10px rgba(232, 195, 126, 0.35);
}
.nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links a {
  color: var(--muted); padding: 8px 12px; border-radius: 8px; font-size: 0.94rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav-links a.active { color: var(--gold-2); }

/* ----------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.96rem;
  padding: 11px 20px; border-radius: 11px; border: 1px solid transparent;
  cursor: pointer; transition: transform .08s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap; text-decoration: none; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(160deg, var(--gold-2), var(--gold-deep));
  color: #1c1408; box-shadow: 0 6px 18px rgba(232, 195, 126, 0.28);
}
.btn-primary:hover { box-shadow: 0 8px 26px rgba(232, 195, 126, 0.42); text-decoration: none; }
.btn-ghost {
  background: var(--panel); color: var(--text); border-color: var(--border-2);
}
.btn-ghost:hover { background: var(--panel-2); text-decoration: none; }
.btn-danger { background: rgba(236, 107, 102, 0.14); color: var(--danger-2); border-color: rgba(236, 107, 102, 0.4); }
.btn-danger:hover { background: rgba(236, 107, 102, 0.22); text-decoration: none; }
.btn-sm { padding: 7px 12px; font-size: 0.85rem; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: not-allowed; }

/* ----------------------------------------------------- cards */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm);
}
.card-lg { padding: 34px; border-radius: var(--radius-lg); }

/* ----------------------------------------------------- pills / badges */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  border: 1px solid var(--border-2); background: var(--panel);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.live { background: var(--ok); box-shadow: 0 0 0 4px rgba(102, 207, 138, 0.18); animation: pulse 2s infinite; }
.dot.down { background: var(--danger); box-shadow: 0 0 0 4px rgba(236, 107, 102, 0.16); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } html { scroll-behavior: auto; } }

.badge { display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: 0.76rem; font-weight: 600; }
.badge-ok { background: rgba(102, 207, 138, 0.16); color: var(--ok); }
.badge-danger { background: rgba(236, 107, 102, 0.16); color: var(--danger-2); }
.badge-muted { background: var(--panel-2); color: var(--muted); }
.badge-gold { background: rgba(232, 195, 126, 0.16); color: var(--gold-2); }

/* ----------------------------------------------------- hero */
.hero { padding: 76px 0 56px; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.7rem); margin-bottom: 0.3em; }
.hero h1 .accent {
  background: linear-gradient(120deg, var(--gold-2), var(--teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 1.18rem; color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

/* ----------------------------------------------------- sections / grid */
.section { padding: 46px 0; }
.section h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.step { position: relative; }
.step .num {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(232, 195, 126, 0.12); color: var(--gold-2); margin-bottom: 14px;
  border: 1px solid rgba(232, 195, 126, 0.25);
}
.step h3 { font-size: 1.15rem; }
.step p { color: var(--muted); margin: 0; }

/* ----------------------------------------------------- stat cards */
.stat { text-align: left; }
.stat .label { color: var(--faint); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
.stat .value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--text); margin-top: 4px; }
.stat .value.gold { color: var(--gold-2); }

/* ----------------------------------------------------- forms */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.field .hint { font-size: 0.82rem; color: var(--faint); margin-top: 6px; }
.field .opt { color: var(--faint); font-weight: 400; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
  width: 100%; padding: 12px 14px; font-family: inherit; font-size: 0.98rem;
  color: var(--text); background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 195, 126, 0.18);
}
input::placeholder { color: var(--faint); }
input.invalid { border-color: var(--danger); }

/* ----------------------------------------------------- alerts */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 0.92rem; border: 1px solid transparent; margin-bottom: 18px; }
.alert-error { background: rgba(236, 107, 102, 0.12); border-color: rgba(236, 107, 102, 0.35); color: var(--danger-2); }
.alert-ok { background: rgba(102, 207, 138, 0.12); border-color: rgba(102, 207, 138, 0.35); color: var(--ok); }
.alert-warn { background: rgba(232, 195, 126, 0.1); border-color: rgba(232, 195, 126, 0.32); color: var(--gold-2); }
.alert-info { background: rgba(95, 201, 193, 0.1); border-color: rgba(95, 201, 193, 0.3); color: var(--teal); }
[hidden] { display: none !important; }

/* ----------------------------------------------------- code block */
.code {
  background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  font-size: 0.86rem; color: #cdd6e6; position: relative;
}
.code-row { display: flex; align-items: stretch; gap: 8px; }
.code-row .code { flex: 1; }
.copy-btn { align-self: flex-start; }

/* ----------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.table th, table.table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table.table th { color: var(--faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; background: rgba(0,0,0,0.2); position: sticky; top: 0; }
table.table tbody tr:hover { background: var(--panel); }
table.table tbody tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ----------------------------------------------------- footer */
.footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 28px 0; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ----------------------------------------------------- utilities */
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 22px; } .mt-3 { margin-top: 32px; }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.text-sm { font-size: 0.88rem; } .text-lg { font-size: 1.08rem; }

/* spinner */
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.25); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
