:root{
  --bg:#020315;
  --card:#05071f;
  --line:#282a3f;
  --accent:#5b8bff;
  --accent2:#9b6bff;
  --text:#f5f5ff;
  --muted:#9ca3c7;
  --danger:#ff6b8b;
  --radius-xl:24px;
  --shadow-soft:0 18px 50px rgba(0,0,0,0.55);
  --font-main:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; background:radial-gradient(circle at top,#14163a 0,#020315 55%); color:var(--text); font-family:var(--font-main); }
body{ min-height:100vh; display:flex; flex-direction:column; }

.page{ flex:1; display:flex; align-items:center; justify-content:center; padding:24px 16px 12px; }

.card{
  width:100%;
  max-width:980px;
  background:linear-gradient(145deg,rgba(11,15,40,0.96),rgba(5,7,31,0.98));
  border-radius:var(--radius-xl);
  border:1px solid rgba(255,255,255,0.05);
  box-shadow:var(--shadow-soft);
  padding:24px 22px 20px;
}
@media (min-width:900px){ .card{ padding:32px 30px 24px; } }

.cardHeader{ margin-bottom:18px; }
.title{ margin:0 0 6px; font-size:22px; letter-spacing:0.04em; }
.subtitle{ margin:0; font-size:13px; color:var(--muted); line-height:1.6; }
.warn{ color:#fbbf24; font-weight:700; }

.block{ margin-top:18px; padding-top:14px; border-top:1px solid var(--line); }
.blockTitle{ margin:0 0 10px; font-size:14px; font-weight:700; }

.fileBtn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 14px;
  border-radius:999px;
  border:1px dashed var(--accent);
  font-size:13px;
  color:var(--accent);
  cursor:pointer;
  background:rgba(9,17,50,0.7);
}
.fileBtn input[type="file"]{ position:absolute; inset:0; opacity:0; cursor:pointer; }

.refMeta{ margin-top:8px; display:flex; align-items:center; gap:14px; font-size:12px; color:var(--muted); flex-wrap:wrap; }
.check{ display:inline-flex; align-items:center; gap:6px; cursor:pointer; }
.check input{ accent-color:var(--accent); }

.refList{ margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; }
.refThumb{ width:74px; height:74px; border-radius:14px; overflow:hidden; border:1px solid var(--line); background:#050716; display:flex; align-items:center; justify-content:center; position:relative; }
.refThumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.refThumb .meta{
  position:absolute; left:6px; right:6px; bottom:6px;
  font-size:10px; color:rgba(255,255,255,0.85);
  background:rgba(2,6,23,0.55); border:1px solid rgba(255,255,255,0.08);
  padding:2px 6px; border-radius:999px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

textarea{
  width:100%;
  border-radius:16px;
  border:1px solid var(--line);
  background:#05071f;
  color:var(--text);
  padding:10px 11px;
  font-size:13px;
  resize:vertical;
  min-height:90px;
}
textarea:focus{ outline:1px solid var(--accent2); border-color:var(--accent2); }
textarea::placeholder{ color:rgba(156,163,199,0.7); }

.primaryBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 18px;
  border-radius:999px;
  border:none;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  color:white;
  box-shadow:0 10px 30px rgba(0,0,0,0.5);
}
.primaryBtn:disabled{ opacity:0.55; cursor:default; box-shadow:none; }

.statusRow{ margin-top:10px; display:flex; align-items:center; gap:10px; min-height:38px; }
.loader{
  width:26px; height:26px; border-radius:999px;
  border:3px solid rgba(255,255,255,0.12);
  border-top-color:var(--accent2);
  animation:spin 0.8s linear infinite;
  display:none;
}
.loader.active{ display:block; }
@keyframes spin{ from{ transform:rotate(0deg);} to{ transform:rotate(360deg);} }

.statusText{ font-size:12px; color:var(--muted); flex:1; }

.resultArea{
  margin-top:10px;
  border-radius:18px;
  border:1px solid var(--line);
  background:radial-gradient(circle at top,#171933 0,#050716 55%);
  min-height:260px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  position:relative;
}
.resultArea img{ max-width:100%; max-height:420px; display:none; border-radius:16px; }
.resultHint{ position:absolute; color:#6b7280; font-size:13px; padding:14px; text-align:center; }

.siteFooter{ width:100%; text-align:center; padding:14px 10px 18px; font-size:13px; font-weight:700; color:var(--muted); }

/* Language dropdown row */
.langRow{
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  opacity: 0.9;
}
.langLabel{
  color: rgba(255,255,255,0.7);
}
.langSelect{
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(15,23,42,0.85);
  color: #e5e7eb;
  font-size: 13px;
}
.langSelect:focus{
  outline: none;
  box-shadow: 0 0 0 1px rgba(96,165,250,0.7);
}
