/* ===================================================================
   Undangankita — main.css
   Global styles: landing, login, dashboard
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sacramento&family=Poppins:wght@300;400;500;600;700&family=Waterfall&display=swap');

/* ─── CSS Variables ─── */
:root {
  --primary: #8b703a;
  --accent: #d5aa6f;
  --bg: #fffdf7;
  --text: #2d2d2d;
  --text-light: #777;
  --border: #e8dcc8;
  --white: #ffffff;
  --shadow: 0 4px 20px rgba(139,112,58,0.12);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ─── Typography ─── */
h1, h2, h3 { line-height: 1.2; }
.font-sacramento { font-family: 'Sacramento', cursive; }

/* ─── Utilities ─── */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: #7a6033;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139,112,58,0.3);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}
.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.85rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ─── NAVBAR ─── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,253,247,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  font-family: 'Sacramento', cursive;
  font-size: 2rem;
  color: var(--primary);
  font-weight: 400;
}
.navbar-brand span { color: var(--accent); }
.navbar-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}
.navbar-links a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.navbar-links a:hover { color: var(--primary); }
.navbar-actions { display: flex; gap: 0.75rem; align-items: center; }
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--primary);
}

/* ─── HERO ─── */
.hero {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a0e00 0%, #3d2b00 40%, #1a0e00 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 1.5rem 4rem;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d5aa6f' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-floating {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0; left: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-petal {
  position: absolute;
  font-size: 1.5rem;
  animation: floatPetal 8s ease-in-out infinite;
  opacity: 0.4;
}
@keyframes floatPetal {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.4; }
  50% { transform: translateY(-30px) rotate(180deg); opacity: 0.7; }
}
.hero-content { position: relative; z-index: 2; max-width: 700px; }
.hero-badge {
  display: inline-block;
  background: rgba(213,170,111,0.2);
  color: var(--accent);
  border: 1px solid rgba(213,170,111,0.4);
  padding: 0.4rem 1.25rem;
  border-radius: 50px;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}
.hero-title {
  font-family: 'Sacramento', cursive;
  font-size: clamp(3rem, 8vw, 5.5rem);
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}
.hero-title span { color: var(--accent); }
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: rgba(255,255,255,0.8);
  margin-bottom: 2.5rem;
  font-weight: 300;
}
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  margin-top: 3.5rem;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; color: rgba(255,255,255,0.7); }
.hero-stat-num { font-size: 1.75rem; font-weight: 700; color: var(--accent); display: block; }
.hero-stat-label { font-size: 0.8rem; margin-top: 0.25rem; }

/* ─── SECTION STYLES ─── */
.section { padding: 5rem 0; }
.section-title {
  font-family: 'Sacramento', cursive;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  color: var(--primary);
  text-align: center;
  margin-bottom: 0.75rem;
}
.section-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 3rem;
  font-size: 0.95rem;
}
.section-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  margin: 0.75rem auto 2rem;
  border-radius: 2px;
}

/* ─── FEATURE CARDS ─── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  transform: scaleX(0);
  transition: transform 0.3s;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.feature-card:hover::before { transform: scaleX(1); }
.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.1rem; color: var(--primary); margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.9rem; color: var(--text-light); }

/* ─── HOW IT WORKS ─── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  position: relative;
}
.step-card { text-align: center; padding: 1.5rem; }
.step-number {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 15px rgba(139,112,58,0.3);
}
.step-card h3 { font-size: 1rem; color: var(--primary); margin-bottom: 0.4rem; }
.step-card p { font-size: 0.88rem; color: var(--text-light); }

/* ─── TEMPLATE PREVIEW ─── */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}
.template-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}
.template-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow); }
.template-preview {
  height: 220px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sacramento', cursive;
  font-size: 1.8rem;
  color: var(--white);
}
.template-card-footer { padding: 0.75rem 1rem; background: var(--white); }
.template-card-footer h4 { font-size: 0.9rem; color: var(--text); }
.template-card-footer span { font-size: 0.78rem; color: var(--accent); }
.template-gold .template-preview { background: linear-gradient(135deg, #3d2b00, #8b703a); }
.template-rose .template-preview { background: linear-gradient(135deg, #6b2a3a, #c06c84); }
.template-sage .template-preview { background: linear-gradient(135deg, #1a3a26, #4a7c59); }
.template-navy .template-preview { background: linear-gradient(135deg, #0d1a3a, #2c3e6e); }

/* ─── CTA SECTION ─── */
.cta-section {
  background: linear-gradient(135deg, var(--primary), #5a4820);
  padding: 5rem 1.5rem;
  text-align: center;
  color: var(--white);
}
.cta-section h2 { font-family: 'Sacramento', cursive; font-size: 3rem; margin-bottom: 1rem; }
.cta-section p { opacity: 0.85; margin-bottom: 2rem; font-size: 1rem; }
.cta-section .btn-primary { background: var(--accent); border-color: var(--accent); color: #1a0e00; font-weight: 600; }
.cta-section .btn-primary:hover { background: #e8c07a; }

/* ─── FOOTER ─── */
.footer {
  background: #1a0e00;
  color: rgba(255,255,255,0.7);
  padding: 3rem 0 1.5rem;
  font-size: 0.88rem;
}
.footer-content { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-brand { flex: 2; min-width: 200px; }
.footer-brand-name { font-family: 'Sacramento', cursive; font-size: 2rem; color: var(--accent); }
.footer-brand p { margin-top: 0.75rem; line-height: 1.6; opacity: 0.75; }
.footer-links { flex: 1; min-width: 140px; }
.footer-links h4 { color: var(--white); margin-bottom: 1rem; font-size: 0.9rem; }
.footer-links li { list-style: none; margin-bottom: 0.5rem; }
.footer-links a { opacity: 0.75; transition: opacity 0.2s; }
.footer-links a:hover { opacity: 1; color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 2.5rem; padding-top: 1.5rem; text-align: center; opacity: 0.5; }

/* ─── LOGIN PAGE ─── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1rem 2rem;
  background: linear-gradient(135deg, var(--bg) 0%, #f5ede0 100%);
}
.auth-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(139,112,58,0.15);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
}
.auth-logo { font-family: 'Sacramento', cursive; font-size: 2.5rem; color: var(--primary); text-align: center; margin-bottom: 1.75rem; }
.auth-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 1.75rem; }
.auth-tab {
  flex: 1; text-align: center; padding: 0.75rem;
  cursor: pointer; color: var(--text-light);
  font-weight: 500; font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.form-group {
  margin-bottom: 1.25rem;
  width: 100%;
}
.form-label { display: block; font-size: 0.88rem; color: var(--text-light); margin-bottom: 0.4rem; font-weight: 500; }
.form-control {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem; color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,112,58,0.1); }
.form-control::placeholder { color: #bbb; }

input[type="date"].form-control,
input[type="date"] {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-color: var(--white) !important;
  min-height: 46px;
  position: relative;
}

input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  min-height: 1.4em;
  display: block;
  width: 100%;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}
.auth-submit {
  width: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 0.875rem;
  margin-top: 0.5rem;
}
.auth-links { margin-top: 1rem; font-size: 0.85rem; color: var(--text-light); text-align: center; }
.auth-links a { color: var(--primary); font-weight: 500; }
.auth-error {
  background: #fee2e2; border: 1px solid #fca5a5; color: #b91c1c;
  padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.88rem; margin-bottom: 1rem;
}
.auth-success {
  background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46;
  padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.88rem; margin-bottom: 1rem;
}

/* ─── DASHBOARD PAGE ─── */
.dashboard-page { padding-top: 64px; min-height: 100vh; background: #f8f4ee; }
.dashboard-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
}
.dashboard-topbar .brand { font-family: 'Sacramento', cursive; font-size: 2rem; color: var(--primary); }
.dashboard-topbar .user-area { display: flex; align-items: center; gap: 1rem; }
.user-name { font-size: 0.88rem; color: var(--text-light); }
.dashboard-main { padding: 2rem 1.5rem; max-width: 1200px; margin: 0 auto; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.dashboard-title { font-family: 'Sacramento', cursive; font-size: 2.5rem; color: var(--primary); }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.inv-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
}
.inv-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.inv-card-preview {
  height: 160px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sacramento', cursive;
  font-size: 1.6rem;
  color: rgba(255,255,255,0.9);
  position: relative;
}
.inv-card-preview.gold { background: linear-gradient(135deg, #3d2b00, #8b703a); }
.inv-card-preview.rose { background: linear-gradient(135deg, #6b2a3a, #c06c84); }
.inv-card-preview.sage { background: linear-gradient(135deg, #1a3a26, #4a7c59); }
.inv-card-preview.navy { background: linear-gradient(135deg, #0d1a3a, #2c3e6e); }
.inv-card-body { padding: 1.25rem; }
.inv-card-names { font-size: 1.05rem; font-weight: 600; color: var(--text); margin-bottom: 0.3rem; }
.inv-card-date { font-size: 0.82rem; color: var(--text-light); margin-bottom: 0.75rem; }
.inv-card-footer { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1.25rem; border-top: 1px solid var(--border); }
.badge { padding: 0.25rem 0.75rem; border-radius: 50px; font-size: 0.75rem; font-weight: 600; }
.badge-draft { background: #f3f4f6; color: #6b7280; }
.badge-published { background: #d1fae5; color: #065f46; }
.inv-actions { display: flex; gap: 0.4rem; }
.inv-action-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 6px; font-size: 0.78rem;
  border: 1px solid var(--border);
  background: var(--white); cursor: pointer;
  transition: var(--transition); color: var(--text);
}
.inv-action-btn:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.inv-action-btn.danger:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.empty-state {
  grid-column: 1/-1; text-align: center; padding: 4rem 2rem;
  color: var(--text-light);
}
.empty-state-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.25rem; color: var(--primary); margin-bottom: 0.5rem; }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--white); border-radius: 20px;
  padding: 2rem; width: 100%; max-width: 440px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.2);
  animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn {
  from { transform: translateY(-30px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-title { font-family: 'Sacramento', cursive; font-size: 2rem; color: var(--primary); margin-bottom: 1.5rem; }
.modal-footer { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ─── TOAST ─── */
.toast-container { position: fixed; top: 1.25rem; right: 1.25rem; z-index: 99999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  background: var(--white); border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 0.875rem 1.25rem; max-width: 320px;
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.88rem; animation: toastIn 0.3s ease;
  border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── SKELETON LOADER ─── */
.skeleton { background: linear-gradient(90deg, #f0e8d8 25%, #f8f0e0 50%, #f0e8d8 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton-card { height: 240px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .navbar-links { display: none; }
  .navbar-toggle { display: block; }
  .navbar-links.open { display: flex; flex-direction: column; position: fixed; top: 64px; left: 0; right: 0; background: var(--white); padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); gap: 1rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .footer-content { flex-direction: column; }
  .dashboard-title { font-size: 1.8rem; }
}

@media (max-width: 480px) {
  .auth-card { padding: 1.75rem 1.25rem; }
  .inv-grid { grid-template-columns: 1fr; }
  .modal-overlay { padding: 0.75rem; }
  .modal-box {
    padding: 1.75rem 1.25rem;
    border-radius: 18px;
    width: 100%;
    max-width: 100%;
  }
}
