/* ========================================
   The Forever Vault — Core Styles
   ======================================== */

:root {
  /* Brand palette */
  --vault-gold: #c9a84c;
  --vault-gold-light: #e8d48b;
  --vault-gold-shine: linear-gradient(135deg, #d4a843 0%, #f0d675 40%, #c9a84c 60%, #a8873a 100%);
  --vault-dark: #0d1117;
  --vault-darker: #080b10;
  --vault-card: #161b22;
  --vault-border: #30363d;
  --vault-text: #e6edf3;
  --vault-text-muted: #8b949e;
  --vault-accent: #58a6ff;
  --vault-success: #3fb950;
  --vault-warning: #d29922;
  --vault-danger: #f85149;
  --vault-bg-input: #0d1117;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

a { color: var(--vault-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--vault-gold-light); }

img { max-width: 100%; display: block; }

/* ---- Typography ---- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 2.8rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }

.text-gold {
  background: var(--vault-gold-shine);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-muted { color: var(--vault-text-muted); }
.text-center { text-align: center; }

/* ---- Layout ---- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--vault-gold-shine);
  color: var(--vault-darker);
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #e0bc55 0%, #f5e08a 40%, #d4a843 60%, #b8964e 100%);
  color: var(--vault-darker);
  box-shadow: 0 2px 8px rgba(201,168,76,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-secondary {
  background: transparent;
  color: var(--vault-text);
  border: 1px solid var(--vault-border);
}
.btn-secondary:hover {
  border-color: var(--vault-gold-light);
  color: var(--vault-gold-light);
  box-shadow: 0 0 12px rgba(201,168,76,0.15);
}

.btn-danger {
  background: var(--vault-danger);
  color: #fff;
}

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn-block { width: 100%; justify-content: center; }

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

/* ---- Cards ---- */
.card {
  background: var(--vault-card);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}
.card:hover {
  border-color: var(--vault-gold);
}

/* ---- Forms ---- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--vault-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  padding: 12px 16px;
  background: var(--vault-bg-input);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius);
  color: var(--vault-text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: var(--vault-gold);
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ---- Navbar ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--vault-border);
  padding: 0 24px;
}

.navbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--vault-text);
  text-decoration: none;
}
.navbar-brand:hover {
  background: var(--vault-gold-shine);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-brand .icon {
  font-size: 1.5rem;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.navbar-links a {
  color: var(--vault-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.navbar-links a:hover { color: var(--vault-text); }

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 120px 24px 80px;
  background:
    linear-gradient(to bottom, rgba(13,17,23,0.25) 0%, rgba(13,17,23,0.75) 100%),
    url('../images/hero-bg.png') center center / cover no-repeat;
}

.hero h1 {
  font-size: 3.2rem;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.2rem;
  color: var(--vault-text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Feature Cards ---- */
.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--vault-gold-shine);
  color: var(--vault-darker);
  font-size: 1.4rem;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
}

/* ---- Pricing ---- */
.pricing-card {
  text-align: center;
  position: relative;
}
.pricing-card.featured {
  border-color: var(--vault-gold);
  box-shadow: 0 0 30px rgba(201,168,76,0.15), 0 0 60px rgba(201,168,76,0.05);
  border-image: var(--vault-gold-shine) 1;
}
.pricing-card .badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--vault-gold-shine);
  color: var(--vault-darker);
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255,255,255,0.15);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.pricing-price {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 16px 0 8px;
}
.pricing-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--vault-text-muted);
}
.pricing-features {
  list-style: none;
  margin: 24px 0;
  text-align: left;
}
.pricing-features li {
  padding: 8px 0;
  border-bottom: 1px solid var(--vault-border);
  font-size: 0.9rem;
  color: var(--vault-text-muted);
}
.pricing-features li::before {
  content: "✓ ";
  color: var(--vault-success);
  font-weight: 700;
}

/* ---- Auth pages ---- */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--vault-text-muted);
  font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--vault-border);
}

.btn-google {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}
.btn-google:hover {
  background: #f5f5f5;
  color: #333;
}

/* ---- Dashboard Shell ---- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--vault-darker);
  border-right: 1px solid var(--vault-border);
  padding: 20px 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 24px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--vault-text);
  text-decoration: none;
  border-bottom: 1px solid var(--vault-border);
  margin-bottom: 16px;
}

.sidebar-nav {
  list-style: none;
  padding: 0 8px;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius);
  color: var(--vault-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}
.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: rgba(201,168,76,0.08);
  background-image: none;
  color: var(--vault-gold-light);
}

.sidebar-section {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--vault-text-muted);
  padding: 20px 16px 8px;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 32px;
}
.page-header h1 {
  font-size: 1.8rem;
  margin-bottom: 4px;
}
.page-header p {
  color: var(--vault-text-muted);
}

/* ---- Capsule Cards ---- */
.capsule-card {
  cursor: pointer;
}
.capsule-card .capsule-type {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--vault-gold-shine);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.capsule-card .capsule-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 8px 0;
}
.capsule-card .capsule-meta {
  font-size: 0.85rem;
  color: var(--vault-text-muted);
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-draft { background: rgba(139,148,158,0.15); color: var(--vault-text-muted); }
.status-scheduled { background: rgba(88,166,255,0.15); color: var(--vault-accent); }
.status-delivered { background: rgba(63,185,80,0.15); color: var(--vault-success); }
.status-locked { background: rgba(210,153,34,0.15); color: var(--vault-warning); }
.status-cancelled { background: rgba(248,81,73,0.15); color: var(--vault-danger); }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--vault-text-muted);
}
.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state h3 {
  color: var(--vault-text);
  margin-bottom: 8px;
}

/* ---- Stat Cards ---- */
.stat-card {
  text-align: center;
}
.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: var(--vault-gold-shine);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--vault-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* ---- Toast / Notification ---- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideIn 0.3s ease;
  min-width: 280px;
}
.toast-success { background: var(--vault-success); color: #fff; }
.toast-error { background: var(--vault-danger); color: #fff; }
.toast-info { background: var(--vault-accent); color: #fff; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---- Loading ---- */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--vault-border);
  border-top-color: var(--vault-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--vault-card);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-close {
  background: none;
  border: none;
  color: var(--vault-text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--vault-border);
  padding: 40px 24px;
  text-align: center;
  color: var(--vault-text-muted);
  font-size: 0.85rem;
}
.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: block; }
  .navbar-links { display: none; }
}

@media (min-width: 769px) {
  .mobile-menu-btn { display: none; }
}

/* ---- Utility ---- */
.hidden { display: none !important; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 32px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 32px; }
.p-md { padding: 16px; }
