/* Nightplan Design System */

/* CSS Variables */
:root {
  --night: #1a1a2e;
  --twilight: #2d2d44;
  --cream: #faf8f5;
  --mist: #e8e4f0;
  --gold: #d4a574;
  --gold-hover: #c99562;
  --sage: #7d8471;
  --rose: #c4a4a4;
  --font-heading: 'Fraunces', serif;
  --font-body: 'Nunito Sans', sans-serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-full: 100px;
}

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

html {
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--night);
  background-color: var(--cream);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.3;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--gold-hover);
}

/* Header */
.header {
  background: white;
  border-bottom: 1px solid var(--mist);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--night);
}

.logo:hover {
  color: var(--gold);
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--twilight);
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--gold);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: white;
}

.btn-primary:hover {
  background: var(--gold-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--twilight);
  border: 1px solid var(--mist);
}

.btn-secondary:hover {
  background: var(--mist);
  color: var(--night);
}

.btn-full {
  width: 100%;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--night);
  margin-bottom: 1rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--twilight);
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 0;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--night);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--mist);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-group input:focus {
  border-bottom-color: var(--gold);
}

.form-group input::placeholder {
  color: var(--rose);
}

/* Auth Pages */
.auth-container {
  display: flex;
  min-height: 100vh;
}

.auth-left {
  flex: 1;
  background: linear-gradient(135deg, var(--night) 0%, var(--twilight) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(212, 165, 116, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.auth-left-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.auth-logo {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 3rem;
  font-weight: 500;
  color: white;
  margin-bottom: 1rem;
}

.auth-tagline {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--cream);
}

.auth-form-container {
  width: 100%;
  max-width: 360px;
}

.auth-title {
  font-size: 1.75rem;
  color: var(--night);
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--twilight);
  margin-bottom: 2rem;
}

.auth-form {
  margin-bottom: 1.5rem;
}

.auth-switch {
  text-align: center;
  font-size: 0.9rem;
  color: var(--twilight);
}

.auth-switch a {
  font-weight: 600;
}

.error-message {
  background: rgba(196, 164, 164, 0.2);
  color: #8b4444;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Main Content */
.main-content {
  padding: 2rem 0 4rem;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Hero Greeting */
.hero-greeting {
  text-align: center;
  margin-bottom: 3rem;
}

.hero-greeting h1 {
  font-size: 2rem;
  font-weight: 500;
  color: var(--night);
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--twilight);
  font-weight: 300;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  gap: 1.5rem;
}

/* Plan Card */
.plan-card {
  background: white;
}

.plan-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.plan-section {
  padding-left: 1rem;
  border-left: 3px solid var(--gold);
}

.plan-section-title {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.plan-section-content {
  font-size: 0.95rem;
  color: var(--night);
  line-height: 1.7;
}

/* Insight Card */
.insight-card {
  background: var(--twilight);
  color: white;
}

.insight-card .card-title {
  color: rgba(255, 255, 255, 0.9);
}

.insight-content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
  font-style: italic;
}

.insight-empty {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem 0;
}

.empty-state p {
  color: var(--twilight);
  margin-bottom: 1.5rem;
}

/* Log Page */
.log-header {
  text-align: center;
  margin-bottom: 2rem;
}

.log-header h1 {
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--night);
  margin-bottom: 0.25rem;
}

.log-date {
  font-size: 0.95rem;
  color: var(--twilight);
}

.log-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Tasks */
.tasks-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--cream);
  border-radius: var(--radius-sm);
}

.task-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
  cursor: pointer;
}

.task-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--night);
  outline: none;
}

.task-input::placeholder {
  color: var(--rose);
}

.task-remove {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--rose);
  font-size: 1rem;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.task-remove:hover {
  background: rgba(196, 164, 164, 0.2);
  color: #8b4444;
}

/* Energy Selector */
.energy-selector {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
}

.energy-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.energy-btn:hover {
  transform: scale(1.1);
}

.energy-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--mist);
  border: 2px solid var(--mist);
  transition: all 0.2s ease;
}

.energy-btn.selected .energy-circle {
  background: var(--gold);
  border-color: var(--gold);
}

.energy-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--twilight);
}

.energy-btn.selected .energy-label {
  color: var(--gold);
}

/* Reflection Textarea */
.reflection-textarea {
  width: 100%;
  min-height: 150px;
  padding: 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--night);
  background: var(--cream);
  border: none;
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  line-height: 1.7;
}

.reflection-textarea::placeholder {
  color: var(--rose);
}

.reflection-textarea:focus {
  box-shadow: inset 0 0 0 2px var(--gold);
}

/* Responsive */
@media (max-width: 768px) {
  .auth-container {
    flex-direction: column;
  }

  .auth-left {
    padding: 3rem 2rem;
    min-height: auto;
  }

  .auth-logo {
    font-size: 2.5rem;
  }

  .auth-tagline {
    font-size: 1.1rem;
  }

  .hero-greeting h1 {
    font-size: 1.5rem;
  }

  .nav {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.85rem;
  }

  .energy-selector {
    gap: 0.5rem;
  }

  .energy-circle {
    width: 40px;
    height: 40px;
  }
}
