/* MustardSeed Shared Styles */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&display=swap');

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

:root {
  --mustard: #D4A843;
  --mustard-light: #F5E6B8;
  --mustard-glow: #E8C766;
  --earth: #2C1810;
  --earth-mid: #4A3228;
  --sage: #5B7553;
  --sage-light: #8FA886;
  --cream: #FDF8EE;
  --warm-white: #FEFCF7;
  --text: #1A1210;
  --text-secondary: #6B5B52;
  --danger: #C0392B;
  --success: #27AE60;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--warm-white);
  color: var(--text);
  min-height: 100vh;
}

.serif { font-family: 'Source Serif 4', Georgia, serif; }

/* ---- LAYOUT ---- */
.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- NAV ---- */
.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--earth);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-nav .logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--mustard-glow);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.app-nav .logo span {
  color: var(--cream);
  font-weight: 400;
}

.app-nav .nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.app-nav .nav-links a {
  color: rgba(253,248,238,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.app-nav .nav-links a:hover {
  color: var(--mustard-glow);
}

.app-nav .nav-links .btn-nav {
  background: var(--mustard);
  color: var(--earth);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--mustard);
  color: var(--earth);
}
.btn-primary:hover { background: var(--mustard-glow); transform: translateY(-1px); }

.btn-secondary {
  background: var(--earth);
  color: var(--cream);
}
.btn-secondary:hover { background: var(--earth-mid); }

.btn-outline {
  background: transparent;
  color: var(--earth);
  border: 2px solid var(--earth);
}
.btn-outline:hover { background: var(--earth); color: var(--cream); }

.btn-sage {
  background: var(--sage);
  color: white;
}
.btn-sage:hover { background: var(--sage-light); }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: 8px; }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; border-radius: 12px; }
.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ---- FORMS ---- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group .hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid rgba(44,24,16,0.15);
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--mustard);
  box-shadow: 0 0 0 3px rgba(212,168,67,0.15);
}

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

/* ---- CARDS ---- */
.card {
  background: white;
  border-radius: 16px;
  padding: 28px;
  border: 1px solid rgba(44,24,16,0.06);
  box-shadow: 0 1px 3px rgba(44,24,16,0.04);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ---- STAT CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: white;
  border-radius: 14px;
  padding: 20px 24px;
  border: 1px solid rgba(44,24,16,0.06);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--earth);
  line-height: 1;
}

.stat-card .stat-value.mustard { color: var(--mustard); }
.stat-card .stat-value.sage { color: var(--sage); }

/* ---- AUTH PAGE LAYOUT ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(170deg, var(--earth) 0%, #3D2519 48%, var(--earth-mid) 100%);
  padding: 40px 24px;
}

.auth-card {
  background: var(--warm-white);
  border-radius: 20px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-card .auth-logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--mustard);
  margin-bottom: 8px;
}

.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--earth);
}

.auth-card .subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.5;
}

.auth-card .divider {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 20px 0;
  position: relative;
}

.auth-card .divider::before,
.auth-card .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: rgba(44,24,16,0.1);
}
.auth-card .divider::before { left: 0; }
.auth-card .divider::after { right: 0; }

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--mustard);
  font-weight: 600;
  text-decoration: none;
}

/* ---- ALERT ---- */
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: none;
}

.alert-error {
  background: #FDF2F2;
  color: var(--danger);
  border: 1px solid rgba(192,57,43,0.15);
}

.alert-success {
  background: #F0FFF4;
  color: var(--success);
  border: 1px solid rgba(39,174,96,0.15);
}

.alert.show { display: block; }

/* ---- PAGE HEADER ---- */
.page-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid rgba(44,24,16,0.06);
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--earth);
}

.page-header .page-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ---- TABLE ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid rgba(44,24,16,0.08);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(44,24,16,0.05);
  font-size: 0.9rem;
  color: var(--text);
}

.data-table tr:hover td {
  background: rgba(212,168,67,0.04);
}

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-mustard { background: var(--mustard-light); color: var(--earth); }
.badge-sage { background: rgba(91,117,83,0.12); color: var(--sage); }
.badge-earth { background: rgba(44,24,16,0.08); color: var(--earth-mid); }

/* ---- EMAIL CARD ---- */
.email-card {
  background: white;
  border-radius: 14px;
  padding: 24px 28px;
  border: 1px solid rgba(44,24,16,0.06);
  margin-bottom: 16px;
  transition: box-shadow 0.2s;
}

.email-card:hover {
  box-shadow: 0 4px 12px rgba(44,24,16,0.06);
}

.email-card .email-subject {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--earth);
  margin-bottom: 6px;
}

.email-card .email-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.email-card .email-content {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-line;
}

/* ---- GOAL CARD ---- */
.goal-card {
  background: white;
  border-radius: 14px;
  padding: 20px 24px;
  border: 1px solid rgba(44,24,16,0.06);
  margin-bottom: 12px;
}

.goal-card .goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.goal-card .goal-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.goal-card .goal-type {
  font-size: 0.75rem;
  color: var(--sage);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-bar {
  height: 8px;
  background: rgba(44,24,16,0.06);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--sage-light));
  border-radius: 100px;
  transition: width 0.5s ease;
}

.progress-bar .progress-fill.gold {
  background: linear-gradient(90deg, var(--mustard), var(--mustard-glow));
}

/* ---- CHECKBOX GROUP ---- */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid rgba(44,24,16,0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.checkbox-item:hover {
  border-color: var(--mustard);
  background: rgba(212,168,67,0.04);
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--mustard);
}

.checkbox-item.checked {
  border-color: var(--mustard);
  background: rgba(212,168,67,0.08);
}

/* ---- LOADING ---- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(44,24,16,0.1);
  border-top-color: var(--mustard);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  gap: 16px;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

/* ---- TWO-COL LAYOUT ---- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .auth-card { padding: 36px 24px; }
  .two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .checkbox-grid { grid-template-columns: 1fr; }
  .app-nav { padding: 12px 16px; }
  .app-nav .nav-links { gap: 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}
