/* ==========================================================================
   LMS | Staff Merch Request Form
   Dark, premium theme derived from the Labirhin character palette:
   deep charcoal base, teal + coral/salmon accents, warm gold highlight,
   deep red for destructive/rejected states, muted purple for secondary UI.
   ========================================================================== */

:root {
  --bg-0: #121014;
  --bg-1: #1a1720;
  --bg-2: #211d29;
  --surface: #241f2b;
  --surface-raised: #2b2433;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text-hi: #f3f0f5;
  --text-mid: #c7c0d0;
  --text-low: #8d8598;

  --teal: #1f8f74;
  --teal-bright: #2bb694;
  --coral: #e9847a;
  --coral-bright: #f4988e;
  --gold: #f0c34d;
  --purple: #7d6a94;
  --purple-bright: #9884b3;
  --red: #a32a2a;
  --red-bright: #d5453f;

  --gradient-hero: radial-gradient(120% 140% at 15% -10%, rgba(31,143,116,0.28) 0%, rgba(31,143,116,0) 55%),
                    radial-gradient(120% 140% at 100% 0%, rgba(233,132,122,0.20) 0%, rgba(233,132,122,0) 55%),
                    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);

  --shadow-card: 0 10px 30px rgba(0,0,0,0.35);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text-hi);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body.theme-dark {
  background: var(--gradient-hero);
  background-attachment: fixed;
  min-height: 100vh;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text-hi);
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

p { color: var(--text-mid); line-height: 1.6; margin: 0 0 12px; }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ---------------- Top bar ---------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 16, 20, 0.7);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-hi);
}

.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-bright), var(--coral-bright));
  box-shadow: 0 0 12px rgba(43,182,148,0.6);
}

.topbar nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.topbar nav a {
  color: var(--text-mid);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
}
.topbar nav a:hover { color: var(--text-hi); background: var(--surface); text-decoration: none; }
.topbar nav a.active { color: var(--text-hi); background: var(--surface-raised); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
}
.user-chip img { width: 24px; height: 24px; border-radius: 50%; }
.user-chip span { font-size: 0.85rem; color: var(--text-mid); }

/* ---------------- Hero / header ---------------- */

.page-header {
  text-align: center;
  padding: 48px 0 20px;
}
.page-header h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
}
.page-header .eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-bright);
  background: rgba(31,143,116,0.14);
  border: 1px solid rgba(43,182,148,0.3);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

/* ---------------- Notice / callout ---------------- */

.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 0.92rem;
  color: var(--text-mid);
  margin-bottom: 20px;
}
.notice a { color: var(--coral-bright); }
.notice.contact {
  border-left-color: var(--teal-bright);
}

/* ---------------- Cards ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px;
  margin-bottom: 22px;
}

.card-glass {
  background: linear-gradient(180deg, rgba(43,182,148,0.06), rgba(233,132,122,0.03));
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-low);
  margin-bottom: 18px;
}
.section-title::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal-bright);
}

/* ---------------- Discord connect widget ---------------- */

.discord-widget {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  flex-wrap: wrap;
}
.discord-widget .status-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.discord-widget img.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--border-strong);
}
.discord-status-text { font-weight: 600; font-size: 0.95rem; }
.discord-status-sub { font-size: 0.82rem; color: var(--text-low); margin-top: 2px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-pill.ok { background: rgba(43,182,148,0.15); color: var(--teal-bright); }
.status-pill.warn { background: rgba(240,195,77,0.15); color: var(--gold); }
.status-pill.err { background: rgba(213,69,63,0.15); color: var(--red-bright); }

/* ---------------- Forms ---------------- */

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-hi);
  margin-bottom: 6px;
}
.required::after {
  content: ' *';
  color: var(--coral-bright);
}
.field-help {
  font-size: 0.8rem;
  color: var(--text-low);
  margin: 6px 0 0;
}
.field-group { margin-bottom: 22px; }

input[type=text],
input[type=email],
input[type=number],
select,
textarea {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  color: var(--text-hi);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-low); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal-bright);
  box-shadow: 0 0 0 3px rgba(43,182,148,0.18);
}

textarea { resize: vertical; min-height: 100px; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238d8598' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.field-valid { border-color: var(--teal-bright) !important; }
.field-invalid { border-color: var(--red-bright) !important; }
.inline-check {
  margin-top: 8px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.inline-check.ok { color: var(--teal-bright); }
.inline-check.err { color: var(--red-bright); }

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.15s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--teal-bright), var(--teal));
  color: #08130f;
}
.btn-primary:hover { filter: brightness(1.08); text-decoration: none; }

.btn-discord {
  background: #2b2433;
  color: var(--text-hi);
  border: 1px solid var(--border-strong);
}
.btn-discord:hover { background: var(--surface-raised); text-decoration: none; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-hi);
}
.btn-outline:hover { background: var(--surface); text-decoration: none; }

.btn-danger {
  background: linear-gradient(135deg, var(--red-bright), var(--red));
  color: #fff;
}

.btn-block { width: 100%; }
.btn-lg { padding: 15px 26px; font-size: 1rem; }

/* ---------------- Badges / status ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-pending { background: rgba(240,195,77,0.15); color: var(--gold); }
.badge-approved { background: rgba(43,182,148,0.15); color: var(--teal-bright); }
.badge-rejected { background: rgba(213,69,63,0.15); color: var(--red-bright); }
.badge-cancelled { background: rgba(141,133,152,0.15); color: var(--text-low); }

/* ---------------- Toasts ---------------- */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}
.toast {
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--teal-bright);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  font-size: 0.88rem;
  max-width: 320px;
  animation: toast-in 0.2s ease;
}
.toast.error { border-left-color: var(--red-bright); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Success screen ---------------- */

.success-screen {
  text-align: center;
  padding: 60px 20px;
}
.success-icon {
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-bright), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 40px rgba(43,182,148,0.35);
}
.request-id-chip {
  display: inline-block;
  font-family: var(--font-mono);
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  margin: 14px 0 24px;
  color: var(--gold);
  letter-spacing: 0.04em;
}

/* ---------------- Admin dashboard ---------------- */

.admin-shell { max-width: 1180px; margin: 0 auto; padding: 28px 20px 80px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.stat-card .stat-value { font-family: var(--font-display); font-size: 1.9rem; color: var(--text-hi); }
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-low); text-transform: uppercase; letter-spacing: 0.06em; }

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.search-input { max-width: 320px; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
table.data-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-low);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}
table.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-mid);
  vertical-align: top;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.item-link-list { display: flex; flex-direction: column; gap: 4px; }
.item-link-list a { font-size: 0.82rem; word-break: break-all; }

.copy-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
}
.copy-value:hover { border-color: var(--teal-bright); }

/* Mobile: convert table rows into cards */
@media (max-width: 860px) {
  table.data-table thead { display: none; }
  table.data-table, table.data-table tbody, table.data-table tr, table.data-table td {
    display: block; width: 100%;
  }
  table.data-table tr {
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
  }
  table.data-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
  }
  table.data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-low);
    text-align: left;
  }
}

/* ---------------- Modal ---------------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,9,12,0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-card);
}
.modal h2 { font-size: 1.15rem; margin-bottom: 6px; }
.modal .modal-sub { font-size: 0.85rem; color: var(--text-low); margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------------- Error pages ---------------- */

.error-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.error-card {
  text-align: center;
  max-width: 420px;
}
.error-code {
  font-family: var(--font-display);
  font-size: 4rem;
  background: linear-gradient(135deg, var(--coral-bright), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

/* ---------------- Footer ---------------- */

.site-footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-low);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--text-low); }

/* ---------------- Utility ---------------- */

.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .container { padding: 20px 14px 60px; }
  .topbar { padding: 14px 16px; }
}
