/* Variables */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #f97316;
  --accent-hover: #fb923c;
  --accent-glow: rgba(249, 115, 22, 0.2);
  --border: #27272a;
  --border-hover: #3f3f46;
  --success: #22c55e;
  --error: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Satoshi', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); }
h3 { font-size: 1.5rem; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

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

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 1.5rem;
  font-weight: 400;
}

.logo-text {
  font-family: 'Instrument Serif', serif;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition);
}

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

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-email {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.user-badge {
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.user-badge.pro {
  background: var(--accent);
  color: var(--bg-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: 'Satoshi', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 30px var(--accent-glow);
}

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

.btn-ghost:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-large {
  padding: 16px 32px;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Hero Section */
.hero {
  padding: 140px 0 80px;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content {
  max-width: 560px;
}

.hero-title {
  margin-bottom: 24px;
}

.hero-title .highlight {
  background: linear-gradient(90deg, var(--accent), #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.15rem;
  margin-bottom: 32px;
}

.hero-note {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Before/After Visual */
.before-after {
  display: flex;
  gap: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.ba-image {
  position: relative;
  flex: 1;
}

.ba-image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.ba-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ba-divider {
  width: 2px;
  background: var(--accent);
}

/* Upload Section */
.upload-section {
  padding: 40px 0 80px;
  background: var(--bg-secondary);
  min-height: 100vh;
}

.upload-header {
  text-align: center;
  margin-bottom: 40px;
}

.upload-header p {
  color: var(--text-secondary);
  margin-top: 8px;
}

.upload-card {
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid var(--border);
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.upload-zone:hover {
  border-color: var(--accent);
  background: rgba(249, 115, 22, 0.05);
}

.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(249, 115, 22, 0.1);
}

.upload-icon {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.upload-text {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.upload-browse {
  color: var(--accent);
  cursor: pointer;
}

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

.upload-preview {
  position: relative;
  margin-bottom: 24px;
}

.upload-preview img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg-secondary);
}

.remove-preview {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background var(--transition);
}

.remove-preview:hover {
  background: var(--error);
}

/* Style Selector */
.style-selector {
  margin: 24px 0;
}

.style-label {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.style-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.style-option {
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}

.style-option:hover {
  border-color: var(--border-hover);
}

.style-option.active {
  border-color: var(--accent);
  background: rgba(249, 115, 22, 0.1);
}

.style-name {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.style-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-stage {
  margin-top: 24px;
}

.usage-info {
  margin-top: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Spinner */
.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Result Section */
.result-section {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.result-section h3 {
  text-align: center;
  margin-bottom: 24px;
}

.result-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.result-image {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.result-image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.result-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.result-info {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Projects Section */
.projects-section {
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.projects-section h3 {
  margin-bottom: 24px;
}

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

.project-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}

.project-card:hover {
  border-color: var(--border-hover);
}

.project-images {
  display: flex;
  height: 150px;
}

.project-images img {
  flex: 1;
  object-fit: cover;
}

.project-info {
  padding: 16px;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.project-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.project-status.completed {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.project-status.processing {
  background: rgba(249, 115, 22, 0.2);
  color: var(--accent);
}

.project-status.failed {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

/* Features Section */
.features {
  padding: 100px 0;
  background: var(--bg-primary);
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.feature {
  text-align: center;
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 1.5rem;
  margin: 0 auto 20px;
}

.feature h3 {
  margin-bottom: 12px;
  font-family: 'Satoshi', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
}

.feature p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Pricing Section */
.pricing {
  padding: 100px 0;
  background: var(--bg-secondary);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 700px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 40px var(--accent-glow);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 20px;
}

.pricing-header {
  text-align: center;
  margin-bottom: 24px;
}

.pricing-header h3 {
  font-family: 'Satoshi', sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.price {
  font-family: 'Instrument Serif', serif;
  font-size: 3rem;
}

.price span {
  font-size: 1rem;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  margin-bottom: 24px;
}

.pricing-features li {
  padding: 8px 0;
  color: var(--text-secondary);
  position: relative;
  padding-left: 24px;
}

.pricing-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  margin: 24px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal h2 {
  margin-bottom: 24px;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Satoshi', sans-serif;
  font-size: 1rem;
  transition: border-color var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-error {
  color: var(--error);
  font-size: 0.9rem;
  margin-bottom: 16px;
  text-align: center;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

/* Responsive */
@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-content {
    text-align: center;
    max-width: 100%;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .result-comparison {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .nav {
    display: none;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .style-options {
    grid-template-columns: 1fr;
  }

  .result-actions {
    flex-direction: column;
  }
}
