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

:root {
  --brand-from: #347480;
  --brand-to:   #255e6a;
  --brand-mid:  #2d6872;
  --accent:     #449aaa;
  --surface:    #ffffff;
  --surface2:   #f4f8f9;
  --border:     #d0e6ea;
  --text-primary: #0f2f34;
  --text-secondary: #6B7280;
  --text-muted:  #9CA3AF;
  --success:    #10B981;
  --error:      #EF4444;
  --warning:    #F59E0B;
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --shadow-sm:  0 1px 3px rgba(52,116,128,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(52,116,128,.12), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:  0 12px 40px rgba(52,116,128,.16), 0 4px 12px rgba(0,0,0,.08);
  --transition: 0.2s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--surface2);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────── */
.header {
  background: linear-gradient(135deg, var(--brand-from) 0%, var(--brand-to) 100%);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(52,116,128,.3);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}

@media (max-width: 640px) {
  .brand-logo {
    height: 32px;
  }
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 2px;
}

.brand-name {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.lang-switcher {
  display: flex;
  align-items: center;
}

/* ── Custom UI language dropdown ─────────────────────────── */
.ui-lang-dropdown {
  position: relative;
}

.ui-lang-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 9px;
  padding: 7px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.ui-lang-trigger:hover,
.ui-lang-dropdown.open .ui-lang-trigger {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.35);
}

.ui-lang-chevron {
  transition: transform var(--transition);
  opacity: .8;
}

.ui-lang-dropdown.open .ui-lang-chevron {
  transform: rotate(180deg);
}

.ui-lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  list-style: none;
  z-index: 200;
  animation: menuIn .15s ease;
}

.ui-lang-dropdown.open .ui-lang-menu {
  display: block;
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ui-lang-option {
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.ui-lang-option:hover {
  background: var(--surface2);
  color: var(--brand-from);
}

.ui-lang-option.selected {
  background: rgba(52,116,128,.08);
  color: var(--brand-from);
  font-weight: 700;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--brand-from) 0%, var(--brand-to) 100%);
  padding: 48px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 60px;
  background: var(--surface2);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.9);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
  letter-spacing: 0.3px;
  backdrop-filter: blur(8px);
}

.hero-title {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 14px;
}

.hero-sub {
  font-size: 16px;
  color: rgba(255,255,255,.75);
  line-height: 1.6;
  font-weight: 400;
}

/* ── Main ────────────────────────────────────────────────── */
.main {
  flex: 1;
  max-width: 780px;
  width: 100%;
  margin: -40px auto 0;
  padding: 0 20px 60px;
  position: relative;
  z-index: 2;
}

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 36px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-from), var(--brand-to), var(--accent));
}

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 500;
  animation: slideDown .3s ease;
}

.toast.success {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

.toast.error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

.toast.hidden { display: none; }

.toast-icon { font-size: 16px; }

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

/* ── Language Row ────────────────────────────────────────── */
.lang-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 24px;
}

.lang-group { flex: 1; }

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.select-wrap {
  position: relative;
}

.select {
  width: 100%;
  appearance: none;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 40px 11px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.select:hover { border-color: var(--accent); }
.select:focus {
  border-color: var(--brand-from);
  box-shadow: 0 0 0 3px rgba(52,116,128,.12);
  background: var(--surface);
}

.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.swap-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  margin-bottom: 0;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  align-self: flex-end;
}

.swap-btn:hover {
  background: linear-gradient(135deg, var(--brand-from), var(--brand-to));
  border-color: transparent;
  color: #fff;
  transform: rotate(90deg);
  box-shadow: var(--shadow-md);
}

/* ── Drop Zone ───────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface2);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  margin-bottom: 24px;
  overflow: hidden;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--brand-from);
  background: rgba(52,116,128,.04);
  transform: scale(1.005);
  box-shadow: 0 0 0 4px rgba(52,116,128,.08);
}

.drop-zone.drag-over {
  border-style: solid;
  background: rgba(52,116,128,.06);
}

.drop-zone.has-file {
  border-color: var(--success);
  border-style: solid;
  background: rgba(16,185,129,.04);
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.drop-content {
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.drop-content.hidden { display: none; }

.drop-icon-wrap {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, rgba(52,116,128,.1), rgba(52,116,128,.1));
  border: 1px solid rgba(52,116,128,.15);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-from);
  margin-bottom: 4px;
}

.drop-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.drop-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.drop-formats {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.format-badge {
  padding: 3px 10px;
  background: rgba(52,116,128,.08);
  border: 1px solid rgba(52,116,128,.15);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-from);
  letter-spacing: 0.5px;
}

/* File selected state */
.file-icon-wrap {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(5,150,105,.08));
  border: 1px solid rgba(16,185,129,.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  margin-bottom: 4px;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 12px;
  color: var(--text-muted);
}

.file-remove {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid #FECACA;
  border-radius: 6px;
  color: var(--error);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  pointer-events: all;
  transition: var(--transition);
  font-family: inherit;
  z-index: 2;
  position: relative;
}

.file-remove:hover {
  background: #FEF2F2;
  border-color: var(--error);
}

/* ── Field group ─────────────────────────────────────────── */
.field-group { margin-bottom: 24px; }

.input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.input::placeholder { color: var(--text-muted); }
.input:hover { border-color: var(--accent); }
.input:focus {
  border-color: var(--brand-from);
  box-shadow: 0 0 0 3px rgba(52,116,128,.12);
  background: var(--surface);
}

/* ── Progress ────────────────────────────────────────────── */
.progress-wrap {
  margin-bottom: 24px;
  padding: 18px 20px;
  background: rgba(52,116,128,.04);
  border: 1px solid rgba(52,116,128,.12);
  border-radius: var(--radius-md);
  animation: slideDown .3s ease;
}

.progress-wrap.hidden { display: none; }

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

.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-from);
}

.progress-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-mid);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(52,116,128,.12);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand-from), var(--brand-to));
  border-radius: 100px;
  transition: width .4s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  to { left: 200%; }
}

.progress-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Submit button ───────────────────────────────────────── */
.submit-btn {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--brand-from) 0%, var(--brand-to) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(52,116,128,.35);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.2px;
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--brand-to), var(--brand-from));
  opacity: 0;
  transition: opacity var(--transition);
}

.submit-btn:hover::before { opacity: 1; }
.submit-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(52,116,128,.4); }
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.submit-btn span { position: relative; display: flex; align-items: center; gap: 8px; }

.hidden { display: none !important; }

.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Feature cards ───────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(52,116,128,.2);
}

.feature-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(52,116,128,.1), rgba(52,116,128,.1));
  border: 1px solid rgba(52,116,128,.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-from);
  margin-bottom: 14px;
}

.feature-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer span {
  font-weight: 700;
  color: var(--brand-from);
}

.footer-link {
  font-weight: 700;
  color: var(--brand-from);
  text-decoration: none;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--brand-to);
  text-decoration: underline;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; }
  .lang-btn { padding: 5px 8px; font-size: 11px; }
  .hero { padding: 36px 20px 70px; }
  .main { padding: 0 16px 48px; margin-top: -32px; }
  .card { padding: 24px 20px; }
  .lang-row { flex-wrap: wrap; }
  .swap-btn { order: 2; width: 36px; height: 36px; align-self: flex-end; margin-bottom: 4px; }
  .lang-group { flex: 1 1 calc(50% - 28px); }
  .features { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .brand-by { display: none; }
  .lang-row { flex-direction: column; }
  .lang-group { width: 100%; }
  .swap-btn { width: 100%; height: 36px; transform: none; }
  .swap-btn:hover { transform: none; }
}
