:root {
  --bg: #f3efe6;
  --bg-deep: #e7e0d2;
  --ink: #1a2421;
  --muted: #5d6b66;
  --line: rgba(26, 36, 33, 0.12);
  --card: rgba(255, 252, 246, 0.86);
  --accent: #0f7a65;
  --accent-2: #d9772f;
  --danger: #b42318;
  --ok: #0f7a65;
  --shadow: 0 18px 50px rgba(26, 36, 33, 0.08);
  --radius: 22px;
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #dff5ef 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #ffe7cc 0%, transparent 50%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
  line-height: 1.5;
}

.bg-glow {
  position: fixed;
  inset: auto -10% -20% auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(15, 122, 101, 0.18), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.topbar, .main { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  background: rgba(243, 239, 230, 0.72);
  position: sticky;
  top: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0.35rem;
  background: linear-gradient(135deg, var(--accent), #1f9d82 45%, var(--accent-2));
  box-shadow: 0 0 0 4px rgba(15, 122, 101, 0.12);
}

.nav {
  display: flex;
  gap: 0.35rem;
  margin-left: 0.5rem;
  flex: 1;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-link:hover, .nav-link.is-active {
  color: var(--ink);
  background: rgba(255, 252, 246, 0.9);
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-chip {
  display: none;
  align-items: center;
  gap: 0.5rem;
  max-width: 240px;
}

@media (min-width: 840px) {
  .user-chip { display: inline-flex; }
}

.user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  color: var(--muted);
}

.plan-pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #dfe8e4;
}

.plan-pill.plan-pro {
  background: #d7f3eb;
  color: var(--accent);
}

.main {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--accent);
  color: #f7fffc;
  box-shadow: 0 10px 24px rgba(15, 122, 101, 0.25);
}
.btn-secondary {
  background: #fffaf2;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-lg { padding: 0.85rem 1.35rem; font-size: 1.02rem; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.88rem; }
.btn-block { width: 100%; }

.hero {
  display: grid;
  gap: 2rem;
  align-items: center;
  min-height: calc(100vh - 8rem);
}

@media (min-width: 920px) {
  .hero { grid-template-columns: 1.1fr 0.9fr; }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero h1, .tool-header h1, .pricing-header h1, .auth-card h1 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 0 0.85rem;
}

.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
.lede, .tool-header p, .pricing-header p {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 36rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 1.25rem; }
.hero-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
}
.hero-points li::before {
  content: "•";
  color: var(--accent);
  margin-right: 0.55rem;
}

.hero-panel { display: flex; justify-content: center; }
.fake-tool {
  width: min(100%, 380px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1rem;
  animation: float-in 0.7s ease both;
}
.fake-tool-bar { display: flex; gap: 0.35rem; margin-bottom: 1rem; }
.fake-tool-bar span {
  width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #d7cfc0;
}
.fake-drop {
  border: 1.5px dashed rgba(15, 122, 101, 0.35);
  border-radius: 16px;
  padding: 2rem 1rem;
  text-align: center;
  background: rgba(15, 122, 101, 0.04);
  display: grid;
  gap: 0.25rem;
}
.fake-meter {
  height: 0.45rem;
  border-radius: 999px;
  background: #e7e0d2;
  margin: 1rem 0;
  overflow: hidden;
}
.fake-meter-fill {
  width: 68%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #2aa88a);
  animation: grow 1.2s ease both;
}
.fake-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
}
.fake-row em { color: var(--accent); font-style: normal; font-weight: 700; }

.feature-grid {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
}
@media (min-width: 800px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}
.feature-grid article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.feature-grid h2 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
}
.feature-grid p { color: var(--muted); }
.feature-grid a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.tool-layout {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 900px) {
  .tool-layout { grid-template-columns: 1.5fr 0.8fr; align-items: start; }
}

.tool-main, .usage-card, .auth-card, .price-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tool-main { padding: 1.35rem; }
.tool-header { margin-bottom: 1.1rem; }

.dropzone {
  border: 1.5px dashed rgba(15, 122, 101, 0.35);
  border-radius: 18px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  background: rgba(15, 122, 101, 0.03);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(15, 122, 101, 0.08);
  transform: translateY(-1px);
  outline: none;
}
.dropzone-inner { display: grid; gap: 0.25rem; justify-items: center; }
.drop-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #dff3ec;
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.file-card, .file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #fffaf2;
  border: 1px solid var(--line);
}
.file-list { list-style: none; margin: 0.85rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.file-item { margin-top: 0; }
.file-item .meta { display: grid; }
.file-item .actions { display: flex; gap: 0.25rem; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.is-hidden { display: none !important; }

.field-row {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
}
.field-row select, .auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  background: #fffaf2;
}

.tool-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }
.hint { min-height: 1.4em; color: var(--muted); margin: 0.75rem 0 0; }
.hint.is-error { color: var(--danger); }
.hint.is-ok { color: var(--ok); }

.progress {
  margin-top: 1rem;
  display: grid;
  gap: 0.4rem;
}
.progress-bar {
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #2aa88a, var(--accent-2));
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
  width: 35%;
}
.progress.is-indeterminate .progress-bar { width: 100%; opacity: 0.85; }

.usage-card { padding: 1.15rem; position: sticky; top: 5rem; }
.usage-card h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.85rem;
}
.usage-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}
.usage-track {
  height: 0.45rem;
  border-radius: 999px;
  background: #e7e0d2;
  overflow: hidden;
  margin-bottom: 0.85rem;
}
.usage-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.35s ease;
}

.auth-shell {
  min-height: calc(100vh - 8rem);
  display: grid;
  place-items: center;
}
.auth-card {
  width: min(100%, 420px);
  padding: 1.5rem;
  display: grid;
  gap: 0.85rem;
}
.auth-card label { display: grid; gap: 0.35rem; font-weight: 600; }
.auth-switch { margin: 0; color: var(--muted); }
.auth-switch a { color: var(--accent); font-weight: 700; text-decoration: none; }
.form-error { color: var(--danger); margin: 0; }
.reset-link-box {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 122, 101, 0.3);
  background: #dff3ec;
}
.reset-link-box p { margin: 0 0 0.65rem; }

.pricing-header { margin-bottom: 1.5rem; max-width: 40rem; }
.price-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 800px) {
  .price-grid { grid-template-columns: 1fr 1fr; }
}
.price-card { padding: 1.4rem; position: relative; }
.price-card-featured {
  border-color: rgba(15, 122, 101, 0.35);
  box-shadow: 0 18px 50px rgba(15, 122, 101, 0.12);
}
.price-card h2 {
  font-family: var(--font-display);
  margin: 0;
}
.price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin: 0.4rem 0 1rem;
}
.price span { font-size: 1rem; color: var(--muted); font-weight: 600; margin-left: 0.25rem; }
.price-card ul {
  margin: 0 0 1.2rem;
  padding-left: 1.1rem;
  color: var(--muted);
}
.badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  margin: 0;
  background: #ffe7cc;
  color: #8a4b12;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

.toast-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  display: grid;
  gap: 0.5rem;
  width: min(360px, calc(100% - 2rem));
}
.toast {
  background: #1a2421;
  color: #f7fffc;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease both;
}
.toast.is-error { background: #7a1f18; }
.toast.is-ok { background: #0b5c4c; }

@keyframes grow { from { width: 0; } to { width: 68%; } }
@keyframes float-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .topbar { justify-content: space-between; }
}
