/* ==========================================================================
   Plushy.app, Design System CSS
   Based on Warm Craft Editorial v2 (_ds-v2.css), adapted for Nunito.
   Source of truth for all production templates.
   ========================================================================== */

/* ==========================================================================
   Section 1, CSS Custom Properties
   ========================================================================== */
:root {
  /* Colors */
  --bg: #FFF9F3;
  --surface: #FFFFFF;
  --pink: #F47BAE;
  --pink-deep: #E25C95;
  --pink-tint: #FFF0F6;
  --pink-soft: #FCDCEA;
  --blue: #A8D8E8;
  --blue-tint: #E8F4F8;
  --peach: #FFD9CC;
  --text: #2D1B2E;
  --text-muted: #8B6C7F;
  --text-light: #8B6B8E;
  --border: #F0E0EB;
  --success: #6FB98F;
  --warning: #F4A261;
  --error: #E76F51;

  /* Shadows */
  --shadow-sm: 0 2px 12px rgba(244, 123, 174, 0.06);
  --shadow-md: 0 4px 24px rgba(244, 123, 174, 0.10);
  --shadow-lg: 0 12px 40px rgba(244, 123, 174, 0.14);

  /* Typography, Nunito (not Fraunces) */
  --font-display: 'Nunito', -apple-system, sans-serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;

  /* Spacing */
  --space-xs: 4px; --space-sm: 8px; --space-md: 16px;
  --space-lg: 24px; --space-xl: 32px; --space-2xl: 48px;
  --space-3xl: 72px; --space-4xl: 112px;

  /* Radius */
  --radius-sm: 8px; --radius-md: 16px; --radius-lg: 24px;
  --radius-xl: 32px; --radius-full: 9999px;

  /* Layout */
  --content-max: 1080px;
  --app-max: 1280px;
  --content-narrow: 720px;
}

/* ==========================================================================
   Section 2, Reset + Base
   ========================================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

a { color: var(--pink); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--pink-deep); }

img { max-width: 100%; height: auto; }

/* ==========================================================================
   Section 3, Typography scale
   ========================================================================== */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); line-height: 1.2; }
h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 800; }
h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 700; }
h3 { font-size: clamp(20px, 3vw, 26px); font-weight: 700; }
h4 { font-size: 18px; font-weight: 700; }
.hero-title { font-size: clamp(36px, 6vw, 56px); font-weight: 800; }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-center { text-align: center; }
.text-pink { color: var(--pink); }

/* ==========================================================================
   Section 4, Layout containers
   ========================================================================== */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-lg); }
.container-app { max-width: var(--app-max); margin: 0 auto; padding: 0 var(--space-lg); }
.container-narrow { max-width: var(--content-narrow); margin: 0 auto; padding: 0 var(--space-lg); }

/* ==========================================================================
   Section 5, Navigation bar
   ========================================================================== */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 249, 243, 0.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) 0;
}
.site-nav .nav-inner {
  max-width: var(--app-max); margin: 0 auto; padding: 0 var(--space-lg);
  display: flex; align-items: center; justify-content: space-between;
}
.site-nav .logo {
  display: flex; align-items: center; gap: var(--space-sm);
  font-family: var(--font-display); font-weight: 700; font-size: 20px;
  color: var(--text); text-decoration: none;
}
.site-nav .logo img { width: 36px; height: 36px; border-radius: var(--radius-sm); }
.site-nav .nav-links { display: flex; align-items: center; gap: var(--space-lg); list-style: none; }
.site-nav .nav-links a {
  font-family: var(--font-body); font-weight: 500; font-size: 15px;
  color: var(--text); text-decoration: none; transition: color 0.2s;
}
.site-nav .nav-links a:hover { color: var(--pink); }
.site-nav .nav-links .credits-badge {
  background: var(--pink-tint); color: var(--pink); padding: 6px 14px;
  border-radius: var(--radius-full); font-weight: 600; font-size: 14px;
}
.nav-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text); }

@media (max-width: 768px) {
  .site-nav .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: var(--space-md) var(--space-lg); box-shadow: var(--shadow-md); }
  .site-nav .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ==========================================================================
   Section 6, Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  padding: 12px 28px; border-radius: var(--radius-full); border: none;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--pink); color: white;
  box-shadow: 0 4px 12px rgba(244, 123, 174, 0.3);
}
.btn-primary:hover { background: var(--pink-deep); color: white; }
.btn-secondary {
  background: var(--text); color: white;
  box-shadow: 0 4px 12px rgba(45, 27, 46, 0.2);
}
.btn-secondary:hover { background: #3d2b3f; color: white; }
.btn-outline {
  background: transparent; color: var(--text);
  border: 2px solid var(--border);
}
.btn-outline:hover { border-color: var(--pink); color: var(--pink); }
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 17px; }
.btn-block { width: 100%; }

/* ==========================================================================
   Section 7, Cards
   ========================================================================== */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-body { padding: var(--space-lg); }
.card-img { width: 100%; display: block; }

/* ==========================================================================
   Section 8, Upload card (V3 side-by-side)
   ========================================================================== */
.upload-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl); box-shadow: var(--shadow-md);
}
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-md); text-align: center;
  margin-bottom: var(--space-lg); position: relative;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--pink); background: var(--pink-tint);
}
.upload-zone .arrow-hint {
  position: absolute; top: -18px; right: 20px;
  color: var(--pink); font-family: var(--font-display); font-weight: 700;
  font-size: 14px; transform: rotate(12deg);
}
.upload-zone .upload-icon {
  width: 64px; height: 64px; margin: 0 auto var(--space-md);
  background: linear-gradient(135deg, var(--peach), var(--pink));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.upload-zone .upload-icon svg { width: 28px; height: 28px; fill: white; }
.upload-zone .upload-title {
  font-family: var(--font-display); font-weight: 700; color: var(--text); font-size: 16px;
}
.upload-zone .upload-hint { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.upload-buttons {
  display: flex; gap: 10px;
}
.upload-buttons .btn { flex: 1; }

@media (max-width: 480px) {
  .upload-card { padding: var(--space-xl) var(--space-md); }
  .upload-zone { padding: var(--space-xl) var(--space-sm); }
  .upload-zone .arrow-hint { display: none; }
}

/* ==========================================================================
   Section 9, Style selector grid
   ========================================================================== */
.style-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-md);
}
.style-card {
  background: var(--surface); border-radius: var(--radius-md);
  border: 2px solid var(--border); padding: var(--space-sm);
  text-align: center; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
}
.style-card:hover { border-color: var(--pink); box-shadow: var(--shadow-sm); }
.style-card.selected { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(244, 123, 174, 0.2); }
.style-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: var(--space-sm); }
.style-card .style-name { font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--text); }

/* ==========================================================================
   Section 10, Result grid (2x2 batch)
   ========================================================================== */
.result-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md);
}
.result-grid .card { position: relative; }
.result-grid .card-img { aspect-ratio: 1; object-fit: cover; }
.result-grid .variant-label {
  position: absolute; top: var(--space-sm); left: var(--space-sm);
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(4px);
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; color: var(--text);
}
.result-grid .card-actions {
  padding: var(--space-sm) var(--space-md);
  display: flex; justify-content: space-between; align-items: center;
}

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

/* ==========================================================================
   Section 11, Progress bar
   ========================================================================== */
.progress-container { margin-bottom: var(--space-lg); }
.progress-bar-track {
  height: 6px; background: var(--pink-tint); border-radius: var(--radius-full); overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: var(--pink); border-radius: var(--radius-full);
  transition: width 0.5s ease;
}
.progress-message {
  text-align: center; color: var(--text-muted); font-size: 14px;
  margin-top: var(--space-sm); font-style: italic;
}

/* ==========================================================================
   Section 12, Forms (auth pages)
   ========================================================================== */
.form-group { margin-bottom: var(--space-lg); }
.form-label {
  display: block; font-weight: 600; font-size: 14px; color: var(--text);
  margin-bottom: var(--space-sm);
}
.form-input {
  width: 100%; padding: 12px var(--space-md);
  border: 2px solid var(--border); border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 15px; color: var(--text);
  background: var(--surface); transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--pink); outline: none; box-shadow: 0 0 0 3px rgba(244, 123, 174, 0.1); }
.form-input::placeholder { color: var(--text-light); }

.auth-card {
  max-width: 440px; margin: var(--space-3xl) auto;
  background: var(--surface); border-radius: var(--radius-xl);
  padding: var(--space-2xl); box-shadow: var(--shadow-md);
}
.auth-card h2 { text-align: center; margin-bottom: var(--space-xl); }

.btn-google {
  width: 100%; padding: 12px; border: 2px solid var(--border);
  border-radius: var(--radius-md); background: var(--surface);
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  color: var(--text); cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 10px; transition: border-color 0.2s;
}
.btn-google:hover { border-color: var(--pink); }

.form-divider {
  display: flex; align-items: center; gap: var(--space-md);
  margin: var(--space-lg) 0; color: var(--text-muted); font-size: 13px;
}
.form-divider::before, .form-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.form-footer { text-align: center; margin-top: var(--space-lg); font-size: 14px; color: var(--text-muted); }
.form-footer a { color: var(--pink); font-weight: 600; }

/* ==========================================================================
   Section 13, Pricing cards
   ========================================================================== */
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg); max-width: 960px; margin: 0 auto;
}
.pricing-card {
  background: var(--surface); border-radius: var(--radius-xl);
  padding: var(--space-xl); box-shadow: var(--shadow-sm);
  text-align: center; border: 2px solid var(--border);
  transition: box-shadow 0.2s, transform 0.2s;
}
.pricing-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pricing-card.featured {
  border-color: var(--pink); box-shadow: var(--shadow-md);
  position: relative;
}
.pricing-card.featured::before {
  content: 'Most Popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--pink); color: white; padding: 4px 16px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 700; font-family: var(--font-display);
}
.pricing-card .price {
  font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--text);
  margin: var(--space-md) 0 var(--space-xs);
}
.pricing-card .price-period { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.pricing-card .credits {
  font-size: 18px; font-weight: 700; color: var(--pink); margin-bottom: var(--space-lg);
}
.pricing-card .feature-list { list-style: none; text-align: left; margin-bottom: var(--space-xl); }
.pricing-card .feature-list li {
  padding: var(--space-sm) 0; font-size: 14px; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.pricing-card .feature-list li::before { content: '\2713  '; color: var(--success); font-weight: 700; }

/* ==========================================================================
   Section 14, Footer
   ========================================================================== */
.site-footer {
  background: var(--text); color: rgba(255, 255, 255, 0.85);
  padding: var(--space-2xl) 0 var(--space-xl); margin-top: var(--space-3xl);
}
.site-footer a { color: rgba(255, 255, 255, 0.7); }
.site-footer a:hover { color: white; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-xl);
  max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-lg);
}
.footer-brand { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: white; margin-bottom: var(--space-sm); }
.footer-tagline { font-size: 14px; color: rgba(255, 255, 255, 0.6); }
.footer-col h4 { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: white; margin-bottom: var(--space-md); text-transform: uppercase; letter-spacing: 1px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: var(--space-sm); }
.footer-col a { font-size: 14px; }
.footer-bottom {
  max-width: var(--content-max); margin: var(--space-xl) auto 0; padding: var(--space-lg) var(--space-lg) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1); text-align: center;
  font-size: 13px; color: rgba(255, 255, 255, 0.5);
}

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

/* ==========================================================================
   Section 15, Utility spacers
   ========================================================================== */
.mb-0 { margin-bottom: 0; } .mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); } .mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); } .mb-2xl { margin-bottom: var(--space-2xl); }
.mt-md { margin-top: var(--space-md); } .mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); } .mt-2xl { margin-top: var(--space-2xl); }
.p-md { padding: var(--space-md); } .p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); } .gap-md { gap: var(--space-md); } .gap-lg { gap: var(--space-lg); }

.hidden { display: none; }

/* ==========================================================================
   Section 16, Flash messages / alerts
   ========================================================================== */
.alert {
  padding: var(--space-md) var(--space-lg); border-radius: var(--radius-md);
  font-size: 14px; margin-bottom: var(--space-lg);
}
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-danger { background: #fce4ec; color: #c62828; border: 1px solid #f8bbd0; }
.alert-warning { background: #fff8e1; color: #f57f17; border: 1px solid #ffecb3; }
.alert-info { background: var(--blue-tint); color: var(--text); border: 1px solid var(--blue); }
