:root {
  --bg: #f6f1e8;
  --card: #fffdf8;
  --ink: #2d2a25;
  --muted: #837a6d;
  --line: #e6ddcd;
  --accent: #3e5a48;
  --accent-dark: #2f4637;
  --gold: #a98a54;
  --error: #a03c30;
  --ok: #3e5a48;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background:
    radial-gradient(1200px 500px at 50% -150px, #fbf8f1 0%, var(--bg) 60%),
    var(--bg);
  color: var(--ink);
  font-family: "Jost", "Segoe UI", system-ui, sans-serif;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

h1, h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 14px 0;
}

.rule {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}

.rule.gold {
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.7;
}

/* ---------- Gate ---------- */

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gate-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(60, 50, 30, 0.08);
  padding: 44px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}

.gate-card h1 { font-size: 34px; }

.gate-text { color: var(--muted); margin: 10px 0 26px; }

#gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input[type="password"],
#operator {
  width: 100%;
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease;
}

input[type="password"]:focus,
#operator:focus {
  border-color: var(--accent);
}

/* ---------- Layout ---------- */

.app {
  max-width: 660px;
  margin: 0 auto;
  padding: 56px 22px 40px;
}

.hero { text-align: center; }

.monogram {
  width: 74px;
  height: 74px;
  margin: 0 auto;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.hero h1 {
  font-size: clamp(38px, 8vw, 58px);
  margin-bottom: 22px;
}

.lead {
  color: #55504a;
  margin: 0 auto;
  max-width: 540px;
}

/* ---------- Card & form ---------- */

.card {
  margin-top: 42px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(60, 50, 30, 0.07);
  padding: 36px 32px;
}

.field-label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.field-label .sub {
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: #a49a8b;
}

.drop {
  margin-top: 26px;
  border: 1.5px dashed #d4c9b3;
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  background: #fdfbf6;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drop.dragover {
  border-color: var(--accent);
  background: #f3f6f2;
}

.drop-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 24px;
  margin: 0 0 12px;
}

.hint { color: var(--muted); font-size: 14px; margin: 14px 0 0; }

/* ---------- Buttons ---------- */

.primary-btn,
.ghost-btn {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.primary-btn {
  width: 100%;
  margin-top: 24px;
  padding: 16px;
  background: var(--accent);
  color: #f7f5ef;
  border: 1px solid var(--accent);
  font-size: 17px;
  letter-spacing: 0.06em;
}

.primary-btn:hover:not(:disabled) { background: var(--accent-dark); }

.primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.primary-btn.busy {
  opacity: 0.7;
  cursor: progress;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--accent);
  padding: 11px 26px;
}

.ghost-btn:hover { border-color: var(--accent); }

/* ---------- File list ---------- */

.file-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  padding: 9px 2px;
  border-bottom: 1px solid #f0eade;
  font-size: 15px;
}

.file-list .fname {
  overflow-wrap: anywhere;
  color: #4a453e;
}

.file-list .fsize {
  color: var(--muted);
  white-space: nowrap;
  font-size: 13px;
}

.file-list li.too-large .fname { color: var(--error); }

.total {
  margin-top: 14px;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Progress & messages ---------- */

.progress { margin-top: 24px; }

.progress-track {
  height: 8px;
  background: #eee7d9;
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 99px;
  transition: width 0.25s ease;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
}

.message {
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 15px;
}

.message.error {
  background: #f9ece9;
  color: var(--error);
  border: 1px solid #eed6d1;
}

.message.info {
  background: #f1f4ef;
  color: var(--accent-dark);
  border: 1px solid #dde6da;
}

.note {
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
  margin: 16px 0 0;
}

.error {
  color: var(--error);
  font-size: 14.5px;
  min-height: 20px;
  margin-top: 12px;
}

/* ---------- Success ---------- */

.success { text-align: center; }

.success h2 { font-size: 36px; margin-bottom: 12px; }

.success p { color: #55504a; margin: 0 0 22px; }

/* ---------- Footer ---------- */

.footer {
  text-align: center;
  margin-top: 54px;
  color: var(--muted);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 19px;
}

@media (max-width: 520px) {
  .card { padding: 28px 20px; }
  .gate-card { padding: 34px 24px; }
  body { font-size: 16px; }
}
