@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --purple: #7c5cbf;
  --purple-dark: #5a3d9e;
  --purple-light: #b8a5d8;
  --purple-soft: #e8e0f3;
  --purple-bg: #f0ecf6;
  --purple-card: #f7f4fb;
  --lavender: #c9b8e8;
  --lavender-light: #ede7f6;
  --white: #ffffff;
  --bg: #faf9fc;
  --text: #1a1a2e;
  --text-secondary: #5f5f7a;
  --text-light: #8e8ea0;
  --border: #e5e2ec;
  --border-light: #f0edf5;
  --success: #4caf50;
  --success-bg: #e8f5e9;
  --error: #e74c3c;
  --error-bg: #fdecea;
  --warning-bg: #fff8e1;
  --warning-text: #8a6d00;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 2px 8px rgba(124,92,191,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(124,92,191,0.1);
  --shadow-lg: 0 8px 40px rgba(124,92,191,0.12);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-height: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; color: var(--text); line-height: 1.25; }
h1 { font-size: 2.8rem; letter-spacing: -0.02em; }
h2 { font-size: 2rem; }
h3 { font-size: 1.3rem; }

a { color: var(--purple); text-decoration: none; transition: .15s; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: var(--font-body); cursor: pointer; }
input, select, textarea { font-family: var(--font-body); }

/* ═══ NAV ═══ */
.nav {
  height: var(--nav-height); padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  position: sticky; top: 0; z-index: 100;
}
.nav-logo {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 600;
  color: var(--text); text-decoration: none;
}
.nav-logo .icon {
  width: 32px; height: 32px; background: var(--purple); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: .9rem; font-weight: 700;
}
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--text-secondary); font-size: .9rem; font-weight: 500; text-decoration: none; }
.nav-links a:hover { color: var(--purple); text-decoration: none; }
.lang-toggle {
  display: flex; background: var(--lavender-light); border-radius: 20px; overflow: hidden;
}
.lang-btn {
  padding: .35rem .7rem; font-size: .8rem; font-weight: 600; border: none;
  background: none; color: var(--text-secondary); cursor: pointer; transition: .15s;
}
.lang-btn.active { background: var(--purple); color: white; border-radius: 20px; }

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.5rem; border: none; border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 600; cursor: pointer;
  transition: all .15s; text-decoration: none; text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--purple); color: white; }
.btn-primary:hover { background: var(--purple-dark); }
.btn-outline { background: white; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--purple); color: var(--purple); background: var(--purple-card); }
.btn-purple-outline { background: white; color: var(--purple); border: 1.5px solid var(--purple-light); }
.btn-purple-outline:hover { background: var(--purple-card); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.full { width: 100%; }
.btn.sm { padding: .5rem 1rem; font-size: .88rem; }
.btn.lg { padding: .9rem 2rem; font-size: 1rem; }

/* ═══ LAYOUT ═══ */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }
.container.narrow { max-width: 480px; }
.container.medium { max-width: 800px; }

/* ═══ CARDS ═══ */
.card {
  background: white; border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow);
}

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .88rem; font-weight: 500; color: var(--text-secondary); margin-bottom: .4rem; }
.form-input {
  width: 100%; padding: .75rem 1rem; padding-left: 2.5rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .95rem; background: var(--lavender-light);
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(124,92,191,0.1); }
.form-input-plain {
  width: 100%; padding: .75rem 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .95rem; background: white;
  transition: border-color .15s, box-shadow .15s;
}
.form-input-plain:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px rgba(124,92,191,0.1); }
textarea.form-input-plain { resize: vertical; min-height: 80px; }
select.form-input-plain { cursor: pointer; }
.input-icon {
  position: relative;
}
.input-icon .icon {
  position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
  color: var(--text-light); font-size: .9rem;
}

/* ═══ MESSAGES ═══ */
.msg { padding: .7rem 1rem; border-radius: var(--radius-xs); font-size: .88rem; margin-bottom: 1rem; display: none; }
.msg.show { display: block; }
.msg.error { background: var(--error-bg); color: var(--error); border: 1px solid #f5c6c1; }
.msg.success { background: var(--success-bg); color: #2e7d32; border: 1px solid #c8e6c9; }
.msg.info { background: var(--lavender-light); color: var(--purple); border: 1px solid var(--lavender); }

/* ═══ UTILITIES ═══ */
.muted { color: var(--text-secondary); }
.light { color: var(--text-light); }
.center { text-align: center; }
.mt-1 { margin-top: .75rem; }
.mt-2 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .75rem; }
.mb-2 { margin-bottom: 1.5rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ═══ HERO ═══ */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem;
  align-items: center; padding: 4rem 0 3rem; min-height: 70vh;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--purple-soft); color: var(--purple);
  padding: .4rem .9rem; border-radius: 20px; font-size: .85rem; font-weight: 500;
  margin-bottom: 1.5rem;
}
.hero h1 { margin-bottom: 1rem; }
.hero-sub { font-size: 1.05rem; color: var(--text-secondary); max-width: 440px; margin-bottom: 2rem; line-height: 1.7; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-img {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-img img { width: 100%; height: 400px; object-fit: cover; border-radius: var(--radius); }
.hero-float {
  position: absolute; bottom: -10px; left: -10px; background: white;
  border-radius: var(--radius-sm); padding: .7rem 1rem;
  box-shadow: var(--shadow-md); display: flex; align-items: center; gap: .5rem;
}
.hero-float .trend { color: var(--purple); font-size: 1.2rem; }

/* ═══ SECTIONS ═══ */
.section { padding: 4rem 0; }
.section-title { text-align: center; margin-bottom: .5rem; }
.section-sub { text-align: center; color: var(--text-secondary); margin-bottom: 2.5rem; font-size: .95rem; }
.section-divider { border: none; border-top: 1px solid var(--border-light); margin: 0; }

/* ═══ HOW IT WORKS ═══ */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.step-card {
  background: white; border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 1.8rem; text-align: center;
}
.step-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--purple-soft); color: var(--purple);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem; font-size: 1.2rem;
}
.step-card h3 { margin-bottom: .5rem; font-size: 1.1rem; }

/* ═══ PRICING ═══ */
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.plan-card {
  background: white; border: 1.5px solid var(--border-light);
  border-radius: var(--radius); padding: 1.5rem;
  display: flex; flex-direction: column; position: relative;
  transition: box-shadow .2s, border-color .2s;
}
.plan-card:hover { box-shadow: var(--shadow-md); }
.plan-card.popular { border-color: var(--purple); }
.plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--purple); color: white; padding: .25rem .9rem;
  border-radius: 20px; font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.plan-card h3 { font-size: 1.15rem; margin-bottom: .25rem; }
.plan-desc { font-size: .85rem; color: var(--text-secondary); margin-bottom: 1rem; }
.plan-price { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; margin-bottom: .25rem; }
.plan-price small { font-size: .85rem; font-family: var(--font-body); color: var(--text-secondary); font-weight: 400; }
.plan-note { font-size: .8rem; color: var(--success); margin-bottom: 1rem; }
.plan-btn { margin-top: auto; }

.pricing-info {
  text-align: center; margin-top: 1.5rem; padding: .8rem;
  background: var(--warning-bg); border-radius: var(--radius-xs);
  font-size: .88rem; color: var(--warning-text);
}
.features-row {
  display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap;
  margin-top: 1.5rem; font-size: .88rem; color: var(--text-secondary);
}
.features-row span::before { content: "✓ "; color: var(--purple); font-weight: 700; }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2rem; }
.faq-item { background: var(--purple-card); border-radius: var(--radius-sm); padding: 1.2rem; }
.faq-item h4 { font-size: .95rem; margin-bottom: .4rem; font-family: var(--font-body); font-weight: 600; }
.faq-item p { font-size: .85rem; color: var(--text-secondary); }

/* ═══ CTA SECTION ═══ */
.cta-section { text-align: center; padding: 4rem 2rem; }

/* ═══ FOOTER ═══ */
.footer { text-align: center; padding: 2rem; color: var(--text-light); font-size: .85rem; border-top: 1px solid var(--border-light); }

/* ═══ AUTH PAGES ═══ */
.auth-page { min-height: calc(100vh - var(--nav-height)); display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--lavender-light); }
.auth-card { width: 100%; max-width: 440px; background: white; border-radius: var(--radius); padding: 2.5rem; box-shadow: var(--shadow-lg); }
.auth-card .logo-icon { width: 40px; height: 40px; background: var(--purple-soft); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--purple); font-size: 1.1rem; margin-bottom: 1.5rem; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; }
.auth-tab {
  flex: 1; padding: .7rem; text-align: center; border: 1.5px solid var(--border);
  font-weight: 600; font-size: .9rem; cursor: pointer; transition: .15s;
  background: white; color: var(--text-secondary);
}
.auth-tab:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.auth-tab:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }
.auth-tab.active { background: var(--purple); color: white; border-color: var(--purple); }
.auth-footer { display: flex; justify-content: space-between; margin-top: 1rem; font-size: .88rem; }

/* ═══ DASHBOARD ═══ */
.dash-header { background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%); color: white; padding: 2rem; border-radius: var(--radius); margin-bottom: 1.5rem; }
.dash-header h1 { color: white; font-size: 1.8rem; margin-bottom: .25rem; }
.dash-header p { opacity: .85; }

.dash-score {
  display: flex; align-items: center; gap: 1.5rem;
  background: white; border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.score-circle {
  width: 90px; height: 90px; border-radius: 50%;
  background: conic-gradient(var(--purple) calc(var(--score) * 1%), var(--border-light) 0);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.score-inner {
  width: 70px; height: 70px; border-radius: 50%; background: white;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-inner .num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--purple); line-height: 1; }
.score-inner .of { font-size: .65rem; color: var(--text-light); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: white; border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 1rem; }
.stat-card .label { font-size: .78rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; margin-bottom: .3rem; }
.stat-card .val { font-family: var(--font-display); font-size: 1.6rem; color: var(--text); }

/* ═══ TABS ═══ */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border-light); margin-bottom: 1.5rem; overflow-x: auto; }
.tab {
  padding: .75rem 1.2rem; font-size: .9rem; font-weight: 600; color: var(--text-light);
  cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: .15s; white-space: nowrap; font-family: var(--font-body);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--purple); border-bottom-color: var(--purple); }
.tab-panel { display: none; animation: fadeIn .25s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ═══ PHOTO GRID ═══ */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.photo-card {
  background: white; border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  overflow: hidden; position: relative; cursor: pointer; transition: .15s;
}
.photo-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.photo-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-card .meta { padding: .5rem .6rem; font-size: .75rem; color: var(--text-light); text-align: center; font-weight: 500; }
.photo-card .del-btn {
  position: absolute; top: .3rem; right: .3rem; background: rgba(0,0,0,.5);
  color: white; border: none; border-radius: 50%; width: 24px; height: 24px;
  font-size: .75rem; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: .15s; cursor: pointer;
}
.photo-card:hover .del-btn { opacity: 1; }

/* ═══ UPLOAD ═══ */
.upload-area {
  border: 2px dashed var(--lavender); border-radius: var(--radius);
  padding: 1.5rem; text-align: center; cursor: pointer;
  transition: .15s; background: var(--lavender-light);
}
.upload-area:hover, .upload-area.dragover { border-color: var(--purple); background: var(--purple-soft); }
.upload-area .plus { font-size: 2rem; color: var(--purple); margin-bottom: .25rem; }
.upload-area input[type="file"] { display: none; }
.upload-bar { margin-top: .75rem; }
.upload-bar .track { background: var(--border-light); border-radius: 4px; height: 5px; overflow: hidden; }
.upload-bar .fill { height: 100%; background: var(--purple); width: 0%; transition: width .3s; }

/* ═══ ROUTINE TOGGLE ═══ */
.ampm-toggle { display: inline-flex; background: var(--lavender-light); border-radius: 24px; padding: 3px; }
.ampm-btn {
  padding: .45rem 1rem; border-radius: 22px; border: none;
  font-size: .85rem; font-weight: 600; cursor: pointer; transition: .15s;
  background: none; color: var(--text-secondary); display: flex; align-items: center; gap: .35rem;
}
.ampm-btn.active { background: white; color: var(--purple); box-shadow: var(--shadow); }

/* ═══ ROUTINE CHECKLIST ═══ */
.routine-item {
  display: flex; align-items: center; justify-content: space-between;
  background: white; border: 1.5px solid var(--border-light); border-radius: var(--radius-sm);
  padding: .8rem 1rem; margin-bottom: .5rem; transition: .15s;
}
.routine-item.done { border-color: var(--purple-light); background: var(--lavender-light); }
.routine-left { display: flex; align-items: center; gap: .75rem; }
.routine-check {
  width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: .15s; flex-shrink: 0; background: white;
}
.routine-check.checked { background: var(--purple); border-color: var(--purple); color: white; }
.routine-time { font-size: .82rem; color: var(--text-light); }

/* ═══ LOG TABLE ═══ */
.log-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.log-table th, .log-table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--border-light); }
.log-table th { font-weight: 600; color: var(--text-light); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }

/* ═══ BEFORE/AFTER ═══ */
.ba-container {
  background: white; border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 1.5rem; margin-bottom: 1.5rem;
}
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ba-side { text-align: center; }
.ba-side img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }
.ba-label { margin-top: .5rem; font-weight: 600; font-size: .85rem; color: var(--text-secondary); }
.ba-date { font-size: .78rem; color: var(--text-light); }
.ba-select { display: flex; gap: .5rem; margin-bottom: 1rem; align-items: center; flex-wrap: wrap; }

/* ═══ MODAL ═══ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: white; border-radius: var(--radius); padding: 2rem;
  max-width: 500px; width: 100%; max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: fadeIn .2s ease;
}

/* ═══ EMPTY STATE ═══ */
.empty {
  background: var(--purple-card); border: 2px dashed var(--lavender);
  border-radius: var(--radius); padding: 2.5rem; text-align: center;
}
.empty h3 { margin-bottom: .3rem; }
.empty p { color: var(--text-secondary); font-size: .9rem; margin-bottom: 1rem; max-width: 340px; margin-left: auto; margin-right: auto; }

/* ═══ BADGE ═══ */
.badge { display: inline-block; padding: .2rem .7rem; border-radius: 20px; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.badge-active { background: var(--purple-soft); color: var(--purple); }
.badge-inactive { background: var(--border-light); color: var(--text-light); }

/* ═══ WATER TRACKER ═══ */
.water-bar { display: flex; align-items: center; gap: .75rem; margin: .75rem 0; }
.water-track { flex: 1; background: var(--border-light); border-radius: 8px; height: 12px; overflow: hidden; }
.water-fill { height: 100%; background: linear-gradient(90deg, var(--purple-light), var(--purple)); border-radius: 8px; transition: width .3s; }
.water-pct { font-size: .82rem; font-weight: 600; color: var(--purple); min-width: 40px; }

/* ═══ SPINNER ═══ */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero h1 { font-size: 2.2rem; }
  .hero-sub { margin: 1rem auto 2rem; }
  .hero-cta { justify-content: center; }
  .hero-img { max-width: 500px; margin: 0 auto; }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
  .faq-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 1.8rem; }
  .nav { padding: 0 1rem; }
  .container { padding: 1.5rem 1rem; }
  .pricing-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .ba-grid { grid-template-columns: 1fr; }
}

/* ═══ WHY SKINLYTICS SECTION ═══ */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.why-card {
  background: var(--purple-card);
  border: 1px solid var(--lavender);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: transform .2s, box-shadow .2s;
}
.why-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.why-icon { font-size: 2rem; margin-bottom: .75rem; }
.why-card h3 { margin-bottom: .4rem; font-size: 1.05rem; }
.why-card p { font-size: .88rem; line-height: 1.6; margin: 0; }

/* ═══ DISCLAIMER MODAL ═══ */
#disclaimer-overlay { z-index: 9999 !important; }
#disclaimer-btn:disabled { opacity: .5; cursor: not-allowed; }
