/* ── GOOGLE FONTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Serif+Display:ital@0;1&display=swap');

/* ── CSS VARIABLES ────────────────────────────────────────── */
:root {
  --red:        #E63946;
  --red-dark:   #c1121f;
  --red-light:  #ff6b6b;
  --bg:         #ffffff;
  --bg-soft:    #f8f9fa;
  --bg-dark:    #0f0f13;
  --text:       #1a1a2e;
  --text-muted: #6c757d;
  --border:     #e9ecef;
  --shadow:     0 2px 20px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.12);
  --radius:     12px;
  --radius-lg:  20px;
  --font:       'DM Sans', sans-serif;
  --serif:      'DM Serif Display', serif;
  --transition: all 0.2s ease;
}

/* ── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); border: none; outline: none; }
input, textarea, select { font-family: var(--font); outline: none; }

/* ── NAVBAR ───────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
}
.nav-logo span {
  color: var(--red);
}
.nav-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--red);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}
.nav-links a:hover { color: var(--red); }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-login {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  transition: var(--transition);
}
.nav-login:hover { background: var(--bg-soft); }
.nav-signup {
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  background: var(--red);
  padding: 8px 20px;
  border-radius: 8px;
  transition: var(--transition);
}
.nav-signup:hover { background: var(--red-dark); }
.nav-user {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-user-name {
  color: var(--text);
}
.nav-logout {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  background: none;
  border: 1px solid var(--border);
}
.nav-logout:hover { color: var(--red); border-color: var(--red); }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #fff5f5 0%, #ffffff 50%, #fff0f0 100%);
  padding: 80px 40px;
  text-align: center;
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(230,57,70,0.08);
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 20px;
}
.hero h1 span { color: var(--red); }
.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 36px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.hero-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-stat strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}
.hero-stat span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--red);
  color: white;
}
.btn-primary:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(230,57,70,0.3);
}
.btn-secondary {
  background: white;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-1px);
}
.btn-large {
  padding: 16px 36px;
  font-size: 1rem;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── SECTION ──────────────────────────────────────────────── */
.section { padding: 80px 40px; }
.section-soft { background: var(--bg-soft); }
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 56px;
}
.section-tag {
  display: inline-block;
  background: rgba(230,57,70,0.08);
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.section-header h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--text);
  margin-bottom: 12px;
}
.section-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── TOOL GRID ────────────────────────────────────────────── */
.tools-container { max-width: 1200px; margin: 0 auto; }
.tools-category { margin-bottom: 48px; }
.tools-category h3 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.tool-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}
.tool-card:hover {
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.3rem;
}
.tool-card h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.tool-card p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── TOOL PAGE ────────────────────────────────────────────── */
.tool-page { max-width: 760px; margin: 0 auto; padding: 60px 40px; }
.tool-page-header { text-align: center; margin-bottom: 40px; }
.tool-page-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px;
}
.tool-page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.tool-page-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── DROPZONE ─────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-soft);
  position: relative;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--red);
  background: rgba(230,57,70,0.03);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.drop-icon { font-size: 3rem; margin-bottom: 16px; }
.drop-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.drop-sub { font-size: 0.9rem; color: var(--text-muted); }
.drop-sub span {
  color: var(--red);
  font-weight: 600;
  cursor: pointer;
}
.drop-limit {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 12px;
}
.files-selected {
  margin-top: 20px;
  display: none;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}
.file-item-icon { color: var(--red); font-size: 1.1rem; }
.file-item-name { flex: 1; font-weight: 500; }
.file-item-size { color: var(--text-muted); font-size: 0.8rem; }
.file-item-remove {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  background: none;
  border: none;
  padding: 0 4px;
}
.file-item-remove:hover { color: var(--red); }

/* ── TOOL OPTIONS ─────────────────────────────────────────── */
.tool-options {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
  display: none;
}
.tool-options.visible { display: block; }
.option-group { margin-bottom: 16px; }
.option-group:last-child { margin-bottom: 0; }
.option-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.option-select, .option-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
  color: var(--text);
  transition: var(--transition);
}
.option-select:focus, .option-input:focus {
  border-color: var(--red);
}

/* ── PROGRESS ─────────────────────────────────────────────── */
.progress-wrap {
  margin: 20px 0;
  display: none;
}
.progress-wrap.visible { display: block; }
.progress-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-align: center;
}
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 100px;
  width: 0%;
  transition: width 0.3s ease;
  animation: progress-pulse 1.5s ease infinite;
}
@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── RESULT ───────────────────────────────────────────────── */
.result-box {
  background: #f0fff4;
  border: 1.5px solid #86efac;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  display: none;
  margin: 20px 0;
}
.result-box.visible { display: block; }
.result-icon { font-size: 2.5rem; margin-bottom: 12px; }
.result-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #166534;
  margin-bottom: 8px;
}
.result-sub {
  font-size: 0.9rem;
  color: #16a34a;
  margin-bottom: 20px;
}
.result-text {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 0.85rem;
  text-align: left;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 16px;
  display: none;
}

/* ── ERROR BOX ────────────────────────────────────────────── */
.error-box {
  background: #fff5f5;
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: none;
  margin: 20px 0;
  font-size: 0.9rem;
  color: #dc2626;
}
.error-box.visible { display: block; }

/* ── UPGRADE MODAL ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.visible { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
}
.modal h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.modal p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.95rem;
}
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ── AUTH FORMS ───────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--bg-soft);
}
.auth-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.auth-logo p { color: var(--text-muted); font-size: 0.9rem; }
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--text);
  transition: var(--transition);
  background: white;
}
.form-input:focus { border-color: var(--red); }
.form-input.error { border-color: #dc2626; }
.form-error {
  font-size: 0.8rem;
  color: #dc2626;
  margin-top: 6px;
  display: none;
}
.form-error.visible { display: block; }
.auth-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 20px 0;
  position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-switch {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 24px;
}
.auth-switch a { color: var(--red); font-weight: 600; }

/* ── PRICING ──────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}
.pricing-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  position: relative;
  transition: var(--transition);
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pricing-card.featured {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 16px;
  border-radius: 100px;
}
.pricing-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.pricing-price {
  margin-bottom: 8px;
}
.pricing-price strong {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text);
}
.pricing-price span {
  font-size: 0.95rem;
  color: var(--text-muted);
}
.pricing-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.pricing-features {
  list-style: none;
  margin-bottom: 32px;
}
.pricing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li::before {
  content: '✓';
  color: var(--red);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── FEATURES SECTION ─────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
}
.feature-card {
  padding: 32px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(230,57,70,0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}
.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-card p { font-size: 0.9rem; color: var(--text-muted); }

/* ── FOOTER ───────────────────────────────────────────────── */
.footer {
  background: var(--bg-dark);
  color: #9ca3af;
  padding: 64px 40px 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto 48px;
}
.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.7;
  margin-top: 12px;
  max-width: 280px;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
}
.footer-logo-icon {
  width: 30px;
  height: 30px;
  background: var(--red);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
}
.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: white;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  font-size: 0.88rem;
  color: #9ca3af;
  transition: var(--transition);
}
.footer-col ul li a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid #1f2937;
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.82rem;
}

/* ── TOAST ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: white;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 20px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 60px 20px; }
  .section { padding: 60px 20px; }
  .tool-page { padding: 40px 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer { padding: 48px 20px 24px; }
  .auth-card { padding: 32px 24px; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 1.9rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
}