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

:root {
  --accent:    #E9B037;
  --accent-dk: #c9921f;
  --bg:        #32373c;
  --surface:   #3d4349;
  --surface2:  #484f56;
  --text:      #ffffff;
  --text-muted:#adb5bd;
  --danger:    #e53935;
  --success:   #43a047;
  --radius:    9999px;
  --shadow:    0 6px 24px rgba(0,0,0,.4);
  --transition:.2s ease;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
       color: var(--text); background: var(--bg); line-height: 1.5; min-height: 100vh; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, button { font: inherit; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px; border-radius: 9999px; border: none;
  cursor: pointer; font-weight: 600; font-size: .875rem;
  transition: opacity var(--transition), background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:hover { opacity: 1; transform: translateY(-1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary   { background: var(--accent); color: #fff; }
.btn-outline   { background: transparent; color: var(--text); border: 1.5px solid rgba(255,255,255,.25); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-outline-light { background: rgba(255,255,255,.12); color: #fff; border: none; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-full      { width: 100%; justify-content: center; }
.btn-sm        { padding: 5px 12px; font-size: .8rem; }

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-input {
  background: var(--surface2); color: var(--text);
  border: 1.5px solid rgba(255,255,255,.12); border-radius: 8px;
  padding: 9px 12px; width: 100%;
  transition: border-color var(--transition);
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* ── Modals ─────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
  animation: fadeIn .15s ease;
}
.modal.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--surface); border-radius: var(--radius);
  padding: 28px; width: 100%; max-width: 480px;
  position: relative; box-shadow: var(--shadow);
  animation: slideUp .2s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-lg { max-width: 740px; }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer; padding: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text); }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header .modal-close { position: static; }

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 8px; font-size: .875rem; }
.alert-error   { background: rgba(229,57,53,.15); color: #ef9a9a; border: 1px solid rgba(229,57,53,.3); }
.alert-success { background: rgba(67,160,71,.15);  color: #a5d6a7; border: 1px solid rgba(67,160,71,.3); }

/* ── Spinner ────────────────────────────────────────────────────────── */
.spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner-sm { width: 20px; height: 20px; border-width: 2px; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.fullscreen-center {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg); z-index: 50;
}
.fullscreen-center.hidden { display: none; }

/* ── Misc ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.mt-sm  { margin-top: 10px; }
.mt-lg  { margin-top: 24px; }
hr.divider { border: none; border-top: 1px solid rgba(255,255,255,.08); margin: 20px 0; }

.brand-logo { height: 36px; width: auto; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 1rem; }

/* ── Toggle Switch ──────────────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: rgba(255,255,255,.15);
  border-radius: 26px; cursor: pointer; transition: background var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: transform var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
