:root {
  --ink: #0a0a0f;
  --paper: #f5f2eb;
  --cream: #ede9df;
  --accent: #c8442f;
  --accent2: #2a6049;
  --gold: #c9a84c;
  --muted: #7a7670;
  --border: rgba(10, 10, 15, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body.auth-locked {
  overflow: hidden;
}

body.processing-lock {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.5;
}

.icon-stroke {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 3rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(245, 242, 235, 0.88);
  backdrop-filter: blur(12px);
  z-index: 100;
  gap: 1rem;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(14, 14, 20, 0.42);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-gate::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

.auth-card {
  background: #f4f1ea;
  border-radius: 2rem;
  width: 100%;
  max-width: 480px;
  padding: 2.8rem 2.6rem;
  position: relative;
  box-shadow:
    0 2px 0 rgba(255,255,255,.7) inset,
    0 30px 80px rgba(0,0,0,.12),
    0 1px 3px rgba(0,0,0,.06);
  animation: floatIn .55s cubic-bezier(.34,1.4,.64,1) both;
}

.auth-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(200, 68, 47, 0.08);
  border: 1px solid rgba(200,68,47,.2);
  color: var(--accent);
  padding: .28em .85em;
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}

.auth-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.6s ease infinite;
}

.auth-title {
  font-family: "Syne", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: .75rem;
}

.auth-title em {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  color: var(--accent2);
}

.auth-subtitle {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 1.8rem;
}

.auth-tabs {
  display: flex;
  gap: .35rem;
  background: var(--cream);
  border-radius: .8rem;
  padding: .3rem;
  margin-bottom: 1.8rem;
}

.auth-tab {
  flex: 1;
  padding: .55rem .8rem;
  border: none;
  border-radius: .55rem;
  background: transparent;
  color: var(--muted);
  font-family: "DM Sans", sans-serif;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .25s;
}

.auth-tab.active {
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.9);
}

.auth-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
  margin-bottom: 1.8rem;
}

.auth-stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  position: relative;
  overflow: hidden;
}

.auth-stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent2), transparent);
}

.auth-stat-num {
  font-family: "Syne", sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  margin-bottom: .2rem;
}

.auth-stat-label {
  font-size: .78rem;
  color: var(--muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.auth-field-label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--muted);
  text-transform: uppercase;
}

.auth-field input {
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: .85rem;
  padding: .85rem 1.1rem;
  font-family: "DM Sans", sans-serif;
  font-size: .92rem;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.auth-field input::placeholder {
  color: #bbb8b1;
}

.auth-field input:focus {
  border-color: var(--accent2);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(42,96,73,.1);
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.auth-button {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: .85rem;
  color: white;
  font-family: "Syne", sans-serif;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  position: relative;
  overflow: hidden;
}

.auth-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.07));
}

.auth-button-dark {
  background: var(--ink);
}

.auth-button-accent {
  background: var(--accent);
  box-shadow: 0 6px 24px rgba(200,68,47,.3);
}

.auth-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.auth-button-dark:hover:not(:disabled) {
  box-shadow: 0 10px 30px rgba(14,14,20,.25);
}

.auth-button-accent:hover:not(:disabled) {
  box-shadow: 0 12px 35px rgba(200,68,47,.4);
}

.auth-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.auth-arrow {
  transition: transform .25s;
}

.auth-button:hover:not(:disabled) .auth-arrow {
  transform: translateX(3px);
}

.auth-status {
  font-size: .78rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  margin-top: .6rem;
}

.auth-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  justify-content: center;
  font-size: .78rem;
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.auth-nav-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}

.auth-status.error {
  color: var(--accent);
}

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

.auth-nav-link span {
  color: var(--accent2);
  font-weight: 500;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.7rem 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
}

.account-chip-copy {
  display: grid;
  gap: 0.05rem;
}

.account-chip-copy strong {
  font-size: 0.8rem;
}

.account-chip-copy span {
  font-size: 0.72rem;
  color: var(--muted);
}

.account-chip-action {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  padding: 0 0.85rem;
  font: inherit;
  cursor: pointer;
}

.logo {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-dot {
  color: var(--accent);
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--accent);
  color: white;
  padding: 0.2em 0.55em;
  border-radius: 100px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

nav {
  display: flex;
  gap: 2rem;
  font-size: 0.88rem;
  color: var(--muted);
}

nav a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--ink);
}

.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 3rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  animation: fadeUp 0.5s ease both;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--accent);
}

h1 {
  margin: 0 0 1.2rem;
  font-family: "Syne", sans-serif;
  font-size: clamp(2.4rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h1 em {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-weight: 400;
  color: var(--accent2);
}

.hero-desc {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 360px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
}

.stat-val {
  font-family: "Syne", sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.hero-formats {
  background: var(--ink);
  border-radius: 1rem;
  padding: 1.8rem;
  color: white;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero-formats::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(200, 68, 47, 0.25) 0%, transparent 60%);
}

.formats-label {
  position: relative;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 1.2rem;
}

.formats-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.fmt-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  padding: 0.6rem 0.8rem;
  font-family: "Syne", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.fmt-pill:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
}

.fmt-pill.active {
  background: var(--accent);
  border-color: var(--accent);
}

.main-section,
.features,
.preview-section {
  max-width: 1100px;
  margin: 0 auto;
}

.main-section {
  padding: 0 3rem 2rem;
}

.card,
.preview-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  overflow: hidden;
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  animation: fadeUp 0.6s ease both;
}

.upload-zone,
.lang-zone,
.action-zone,
#loadingState,
#successState {
  padding-inline: 3rem;
}

.upload-zone {
  padding-top: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.lang-zone {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.action-zone {
  padding-top: 2rem;
  padding-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.upload-title {
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-num {
  width: 26px;
  height: 26px;
  background: var(--ink);
  color: white;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone {
  display: block;
  border: 2px dashed var(--border);
  border-radius: 1rem;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(200, 68, 47, 0.04);
  transform: scale(1.005);
}

.dropzone.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.dropzone.disabled::before,
.dropzone.disabled:hover::before {
  opacity: 0;
}

.dropzone.drag-over .upload-icon {
  transform: translateY(-6px) scale(1.05);
}

.dropzone::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(200, 68, 47, 0.06), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}

.dropzone:hover::before,
.dropzone.drag-over::before {
  opacity: 1;
}

.upload-icon {
  width: 64px;
  height: 64px;
  background: var(--ink);
  color: white;
  border-radius: 1rem;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dropzone:hover .upload-icon {
  transform: translateY(-4px) rotate(-3deg);
}

.upload-icon::after {
  content: "";
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid white;
}

.dropzone h3 {
  margin: 0 0 0.4rem;
  font-family: "Syne", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.dropzone p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.dropzone p span {
  color: var(--accent);
  font-weight: 500;
}

.file-types {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.file-tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--cream);
  color: var(--muted);
  padding: 0.25em 0.65em;
  border-radius: 0.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.file-attached {
  display: none;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.6rem;
  background: var(--cream);
  border-radius: 1rem;
  margin-top: 1rem;
  border: 1px solid var(--border);
  animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.file-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.file-icon-box.pdf {
  background: rgba(200, 68, 47, 0.12);
}

.file-icon-box.word {
  background: rgba(42, 96, 73, 0.12);
}

.file-icon-box.img {
  background: rgba(201, 168, 76, 0.15);
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.file-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.file-remove {
  width: 28px;
  height: 28px;
  background: rgba(200, 68, 47, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--accent);
  transition: transform 0.2s ease, background 0.2s ease;
}

.file-remove:hover {
  transform: scale(1.06);
  background: rgba(200, 68, 47, 0.18);
}

.languages {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.2rem;
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  background: white;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.lang-btn:hover {
  border-color: var(--accent);
  background: rgba(200, 68, 47, 0.04);
  transform: translateY(-1px);
}

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

.lang-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 20px rgba(200, 68, 47, 0.3);
  transform: translateY(-2px);
}

.lang-btn.selected .lang-flag {
  filter: saturate(1.1);
}

.lang-flag {
  font-size: 1.1rem;
}

.translate-info {
  font-size: 0.84rem;
  color: var(--muted);
  max-width: 360px;
  line-height: 1.5;
}

.translate-info strong {
  color: var(--ink);
}

.translate-info.error {
  color: var(--accent);
}

.btn-translate {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 0.9rem;
  padding: 1rem 2.2rem;
  font-family: "Syne", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-translate::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.08));
}

.btn-translate::after {
  content: "";
  position: absolute;
  inset: auto auto 0 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  transform: translateX(-100%);
}

.btn-translate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(10, 10, 15, 0.3);
}

.btn-translate:hover:not(:disabled)::after {
  transform: translateX(100%);
  transition: transform 0.8s ease;
}

.btn-translate:disabled {
  opacity: 0.7;
  cursor: wait;
}

.btn-translate .arrow {
  transition: transform 0.3s;
}

.btn-translate:hover:not(:disabled) .arrow {
  transform: translateX(4px);
}

#loadingState,
#successState {
  display: none;
}

#loadingState {
  position: fixed;
  inset: 0;
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: rgba(14, 14, 20, 0.34);
  backdrop-filter: blur(14px);
}

#loadingState::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

.loading-modal {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 1.8rem;
  background: rgba(244, 241, 234, 0.94);
  box-shadow:
    0 2px 0 rgba(255,255,255,.72) inset,
    0 30px 90px rgba(0,0,0,.22),
    0 1px 3px rgba(0,0,0,.08);
  padding: 3rem 2.4rem;
  text-align: center;
  animation: floatIn .35s cubic-bezier(.34,1.4,.64,1) both;
}

.loading-modal::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1.8rem;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.loading-modal > * {
  position: relative;
  z-index: 1;
}

.loading-visual {
  width: 90px;
  height: 90px;
  margin: 0 auto 2rem;
  position: relative;
}

.loading-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}

.ring1 {
  border-top-color: var(--accent);
  animation: spin 1.2s linear infinite;
}

.ring2 {
  inset: 10px;
  border-right-color: var(--accent2);
  animation: spin 1.8s linear infinite reverse;
}

.ring3 {
  inset: 20px;
  border-bottom-color: var(--gold);
  animation: spin 2.4s linear infinite;
}

.loading-center {
  position: absolute;
  inset: 30px;
  background: var(--paper);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Syne", sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.loading-title,
.success-title {
  font-family: "Syne", sans-serif;
  font-weight: 800;
}

.loading-title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.loading-sub,
.success-sub {
  font-size: 0.9rem;
  color: var(--muted);
}

.loading-sub {
  margin-bottom: 2rem;
}

.progress-bar-wrap {
  max-width: 380px;
  margin: 0 auto 1rem;
  background: var(--cream);
  border-radius: 100px;
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0%;
  transition: width 0.4s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent);
}

.progress-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: "Syne", sans-serif;
  font-weight: 700;
}

.loading-steps {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.lstep {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.lstep-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: all 0.4s;
}

.lstep.done .lstep-icon {
  background: var(--accent2);
  border-color: var(--accent2);
  color: white;
}

.lstep.active .lstep-icon {
  border-color: var(--accent);
  color: var(--accent);
  animation: pulse 1s ease infinite;
}

#successState {
  border-top: 1px solid var(--border);
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
  text-align: center;
}

.processing-lock header,
.processing-lock .hero,
.processing-lock .main-section,
.processing-lock .preview-section,
.processing-lock .features,
.processing-lock footer {
  pointer-events: none;
  user-select: none;
}

.processing-lock .card,
.processing-lock .preview-card {
  filter: saturate(0.9);
}

.success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--accent2), #3d8a6a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-icon .icon-stroke {
  width: 28px;
  height: 28px;
}

.success-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.success-sub {
  margin-bottom: 2.5rem;
}

.download-cards {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.dl-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 2rem;
  border: 2px solid var(--border);
  border-radius: 1rem;
  cursor: pointer;
  text-decoration: none;
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  background: white;
  color: var(--ink);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 240px;
  position: relative;
  overflow: hidden;
}

.dl-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
}

.dl-card:hover {
  transform: translateY(-3px);
}

.pdf-card {
  border-color: rgba(200, 68, 47, 0.3);
}

.pdf-card::before {
  background: rgba(200, 68, 47, 0.04);
}

.pdf-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(200, 68, 47, 0.15);
}

.word-card {
  border-color: rgba(42, 96, 73, 0.3);
}

.word-card::before {
  background: rgba(42, 96, 73, 0.04);
}

.word-card:hover {
  border-color: var(--accent2);
  box-shadow: 0 8px 30px rgba(42, 96, 73, 0.15);
}

.dl-card:hover::before {
  opacity: 1;
}

.dl-icon {
  width: 42px;
  height: 42px;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.pdf-card .dl-icon {
  background: rgba(200, 68, 47, 0.12);
}

.word-card .dl-icon {
  background: rgba(42, 96, 73, 0.12);
}

.dl-info {
  text-align: left;
}

.dl-format {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.dl-arrow {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: background 0.2s, transform 0.3s;
}

.dl-card:hover .dl-arrow {
  transform: translateX(2px) translateY(2px);
}

.pdf-card:hover .dl-arrow {
  background: var(--accent);
  color: white;
}

.word-card:hover .dl-arrow {
  background: var(--accent2);
  color: white;
}

.retry-btn {
  margin-top: 1.8rem;
  background: none;
  border: 1.5px solid var(--border);
  padding: 0.6rem 1.4rem;
  border-radius: 0.7rem;
  font-family: "DM Sans", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.preview-section {
  padding: 0 3rem 4rem;
}

.preview-card {
  padding: 1.4rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,244,238,0.95));
}

.preview-topline {
  padding: 0.3rem 0.3rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.preview-card h2 {
  margin: 0.2rem 0 0;
  font-family: "Syne", sans-serif;
  font-size: 1.5rem;
}

.preview-chip {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.9);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent2);
}

.preview-frame {
  width: 100%;
  height: 920px;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: white;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.features {
  padding: 0 3rem 5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.feat {
  padding: 1.8rem;
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  background: white;
  transition: transform 0.3s, box-shadow 0.3s;
}

.feat:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

.feat-icon {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  width: 50px;
  height: 50px;
  border-radius: 0.8rem;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feat h3 {
  margin: 0 0 0.4rem;
  font-family: "Syne", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.feat p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.6;
}

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  max-width: 1100px;
  margin: 0 auto;
}

.hidden {
  display: none;
}

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

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(200, 68, 47, 0.3);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(200, 68, 47, 0);
  }
}

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

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@media (max-width: 768px) {
  header {
    padding: 1rem 1.5rem;
  }

  nav {
    display: none;
  }

  .account-chip {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3rem 1.5rem 2rem;
  }

  .hero-formats {
    display: none;
  }

  .main-section,
  .features,
  .preview-section {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .upload-zone,
  .lang-zone,
  .action-zone,
  #successState {
    padding-inline: 1.5rem;
  }

  .loading-modal {
    padding: 2.2rem 1.2rem;
  }

  .action-zone {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-translate {
    width: 100%;
    justify-content: center;
  }

  .features {
    grid-template-columns: 1fr;
    padding-bottom: 3rem;
  }

  .auth-card {
    padding: 1.4rem;
  }

  .auth-stats {
    grid-template-columns: 1fr;
  }

  .auth-nav-links {
    flex-direction: column;
    gap: 0.45rem;
  }

  .preview-frame {
    height: 680px;
  }

  footer {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
    padding: 1.5rem;
  }
}

@keyframes floatIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes blink {
  0%,100% { opacity: 1; }
  50% { opacity: .3; }
}
