/* ========================================
   CONSOLIDATED STYLESHEET
   ======================================== */

/* ========== RESET & BASE STYLES ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ========== CSS VARIABLES (THEMING) ========== */
:root {
  /* Backgrounds */
  --bg: #09090f;
  --surface: #111118;
  --surface2: #16161f;
  --input-bg: #18181f;

  /* Colors & Accents */
  --accent: #c9a84c;
  --accent-dim: rgba(201, 168, 76, 0.12);
  --accent-glow: rgba(201, 168, 76, 0.06);
  --loading-color: #444;

  /* Text & Borders */
  --text: #f0ede6;
  --muted: #7a7870;
  --muted2: #3a3835;
  --error: #e05c5c;
  --success: #5ce08a;
  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.12);
}

/* ========== BODY & BACKGROUNDS ========== */
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
}

/* Login page centered layout */
body:has(.card[style*="max-width"]),
body:has(.tabs) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(201, 168, 76, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}



/* ========== NAVIGATION ========== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 15, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: var(--accent);
  letter-spacing: -0.3px;
}

.nav-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user {
  font-size: 13px;
  color: var(--muted);
}

.nav-user span {
  color: var(--text);
  font-weight: 500;
}

.nav-btn {
  padding: 7px 16px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  transition: all 0.2s;
}

.nav-btn:hover {
  color: var(--text);
  border-color: var(--border2);
}

.nav-btn.admin {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-btn.admin:hover {
  background: var(--accent-dim);
}

/* ========== LAYOUT ========== */
.layout {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 28px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}

/* ========== SIDEBAR ========== */
.sidebar {
  position: sticky;
  top: 80px;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0 12px;
  font-weight: 500;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  transition: all 0.15s;
  border: 1px solid transparent;
}

.sidebar-item:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.sidebar-item.active {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.sidebar-item.active .sidebar-dot {
  background: var(--accent);
}

.sidebar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted2);
  flex-shrink: 0;
}

/* ========== MAIN CONTENT ========== */
.main {
  /* Main content container */
}

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--text);
  margin-bottom: 6px;
}

.page-sub {
  font-size: 14px;
  color: var(--muted);
  font-weight: 300;
}

/* ========== SETTINGS CARDS (ADMIN) ========== */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
}

.settings-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.settings-card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 3px;
}

.settings-card-desc {
  font-size: 13px;
  color: var(--muted);
  font-weight: 300;
}

.settings-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ========== FORM FIELDS ========== */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
  margin-top: 4px;
}

label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* ========== INPUT FIELDS ========== */
input[type='text'],
input[type='email'],
input[type='password'],
input[type='color'],
.color-hex {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

/* Admin form inputs with tighter padding */
.settings-card-body input[type='text'],
.settings-card-body input[type='email'],
.settings-card-body input[type='password'] {
  background: var(--surface2);
  padding: 11px 14px;
}

input[type='text']:focus,
input[type='email']:focus,
input[type='password']:focus,
.color-hex:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

input::placeholder {
  color: var(--muted);
}

input[type='color'] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.color-hex {
  width: 140px;
}

/* ========== COLOR PICKER ========== */
.color-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.color-preview {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s;
}

.color-preview:hover {
  transform: scale(1.05);
}

.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}

.swatch:hover {
  transform: scale(1.1);
}

.swatch.selected {
  border-color: var(--text);
}

/* ========== SAVE BAR (ADMIN) ========== */
.save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
}

.save-status {
  font-size: 13px;
  color: var(--muted);
}

.save-status.saved {
  color: var(--success);
}

.save-status.error {
  color: var(--error);
}

.save-status.saving {
  color: var(--accent);
}

.btn-save {
  padding: 10px 28px;
  background: var(--accent);
  color: #09090f;
  border: none;
  border-radius: 9px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-save:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-save:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ========== PREVIEW CARDS ========== */
.preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.preview-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.preview-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.preview-body {
  padding: 32px 28px;
  text-align: center;
}

.preview-brand {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  margin-bottom: 10px;
}

.preview-title {
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.2;
}

.preview-sub {
  font-size: 14px;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 20px;
}

.preview-pill {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

/* ========== HERO SECTION (HOME/INDEX) ========== */
.hero {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 28px 80px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  font-weight: 500;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 20px;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 18px;
  color: var(--muted);
  font-weight: 300;
  max-width: 540px;
  margin: 0 auto 44px;
  line-height: 1.6;
}

.hero-glow {
  position: absolute;
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

/* ========== BUTTONS ========== */
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary,
.btn {
  padding: 14px 32px;
  background: var(--accent);
  color: #09090f;
  border: none;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-primary:hover,
.btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  padding: 14px 32px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

/* ========== SECTIONS & CARDS ========== */
.section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px 80px;
}

.section-title {
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
  font-weight: 500;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 18px;
}

.card-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.card-body {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 300;
}

/* ========== LOGIN FORM ========== */
.card.form-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 44px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
  animation: fadeUp 0.6s cubic-bezier(0.22, 0.68, 0, 1.2) both;
}

body > .card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: rgba(17, 17, 24, 0.8);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 44px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
  animation: fadeUp 0.6s cubic-bezier(0.22, 0.68, 0, 1.2) both;
  z-index: 1;
}

.btn-back {
  position: fixed;
  top: 22px;
  left: 22px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(17, 17, 24, 0.85);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  z-index: 999;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

/* Pink radial glow - login page (same as home page) */
.login-bg-pink {
  position: fixed;
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

/* Square grid vector (same as homepage) */
.login-bg-squares {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(201, 168, 76, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

body:has(.tabs)::after {
  content: '';
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(201, 168, 76, 0.06) 0%,
    transparent 70%
  );
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.brand {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--accent);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 36px;
  font-weight: 300;
}

.tabs {
  display: flex;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tab-btn.active {
  background: var(--accent);
  color: #09090f;
}

.form {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.form.visible {
  display: flex;
  animation: fadeIn 0.3s ease both;
}

.message {
  text-align: center;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  display: none;
}

.message.error {
  background: rgba(224, 92, 92, 0.1);
  color: var(--error);
  display: block;
}

.message.success {
  background: rgba(92, 224, 138, 0.1);
  color: var(--success);
  display: block;
}

.divider {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ========== DIVIDER ========== */
.divider-line {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 28px;
}

/* ========== LOADING OVERLAY ========== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--loading-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 600px) {
  .nav-user {
    display: none;
  }

  .hero {
    padding: 60px 20px 50px;
  }
}

@media (max-width: 480px) {
  body > .card {
    padding: 36px 28px;
  }
}

/* ========== BODY DISPLAY STATES ========== */
/* Admin page hides body until loaded */
body {
  /* Default state */
}

/* Admin displays body after loaded */
nav {
  /* Nav indicator of loaded state */
}
