/* === SizeSync Design System === */
:root {
  --primary: #6C5CE7;
  --primary-dark: #5A4BD1;
  --primary-light: #A29BFE;
  --accent: #00CEC9;
  --accent-dark: #00B5B0;
  --surface: #FFFFFF;
  --surface-alt: #F8F7FF;
  --surface-dark: #1A1625;
  --text: #1A1625;
  --text-secondary: #6B6580;
  --text-muted: #9B95A8;
  --border: #E8E5F0;
  --success: #00B894;
  --warning: #FDCB6E;
  --danger: #E17055;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(26, 22, 37, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 22, 37, 0.08);
  --shadow-lg: 0 8px 32px rgba(26, 22, 37, 0.12);
  --shadow-glow: 0 0 40px rgba(108, 92, 231, 0.15);
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === Header === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
}

.logo-icon { font-size: 1.5rem; }

.nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

/* === Hero === */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  background: linear-gradient(180deg, var(--surface-alt) 0%, var(--surface) 100%);
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(108, 92, 231, 0.1);
  color: var(--primary);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 140px;
  text-align: center;
}

/* === Sections === */
.section {
  padding: 72px 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}

.section-sub {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-size: 1rem;
}

/* === Translator === */
.translator-section { background: var(--surface-alt); }

.translator-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.translator-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.select-field, .input-field {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.select-field {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%236B6580' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.select-field:focus, .input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.btn-secondary {
  background: var(--surface-alt);
  color: var(--primary);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.05);
}

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

.btn-outline:hover {
  background: rgba(108, 92, 231, 0.05);
}

.btn-lg { padding: 16px 36px; font-size: 1.05rem; }

.btn-translate {
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
}

.btn-arrow { font-size: 1.2rem; }

/* === Results === */
.hidden { display: none !important; }

.results {
  margin-top: 32px;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.results-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.results-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.result-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}

.result-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.result-brand {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.result-size {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.result-confidence {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.result-fit {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 8px;
}

.fit-true { background: rgba(0, 184, 148, 0.1); color: var(--success); }
.fit-small { background: rgba(253, 203, 110, 0.2); color: #E17055; }
.fit-large { background: rgba(253, 203, 110, 0.2); color: #0984E3; }

/* === Profile === */
.profile-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.fit-pref { margin-bottom: 28px; }

.fit-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fit-btn {
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.fit-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.fit-btn.active {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.08);
  color: var(--primary);
}

/* === Brands === */
.brands-section { background: var(--surface-alt); }

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.brand-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s;
}

.brand-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.brand-name {
  font-weight: 700;
  font-size: 1rem;
}

.brand-reports {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.brand-fit-bar {
  height: 8px;
  border-radius: 100px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 8px;
}

.brand-fit-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.6s ease;
}

.brand-verdict {
  font-size: 0.8rem;
  font-weight: 600;
}

/* === History === */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.history-brand {
  font-weight: 700;
  min-width: 80px;
}

.history-name {
  flex: 1;
  color: var(--text-secondary);
}

.history-size {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

.history-rating {
  font-size: 1.3rem;
}

.add-item-card {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.add-item-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--primary);
}

.add-item-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fit-rating { margin: 4px 0; }

.fit-rating-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.rating-btn {
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.rating-btn:hover { border-color: var(--primary-light); }
.rating-btn.active {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.08);
}

/* === Body Twins === */
.twins-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.twins-match {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.match-badge {
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
}

.match-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.twins-brands {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.twin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}

.twin-score {
  font-weight: 800;
  color: var(--success);
  font-size: 0.9rem;
}

.twin-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.twin-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === CTA === */
.cta-section {
  background: var(--surface-alt);
}

.cta-card {
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 64px 32px;
  box-shadow: var(--shadow-glow);
  border: 1px solid var(--border);
}

.cta-card h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.cta-card p {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 1.05rem;
}

.cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pricing-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === Footer === */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-note {
  margin-top: 8px;
  font-size: 0.8rem;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface-dark);
  color: white;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: transform 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* === Mobile === */
@media (max-width: 768px) {
  .hero { padding: 48px 0 40px; }
  .hero-title { font-size: 2.2rem; }
  .hero-stats { gap: 24px; }
  .stat-num { font-size: 1.5rem; }
  .translator-row { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr 1fr; }
  .results-grid { grid-template-columns: 1fr 1fr; }
  .nav { gap: 20px; }
  .section { padding: 48px 0; }
  .cta-card { padding: 40px 20px; }
  .cta-card h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .profile-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; gap: 16px; }
}
