:root {
  --bg: #0d1512;
  --card: #14201b;
  --card2: #1c2c25;
  --accent: #3fae7a;
  --accent2: #2f8fb0;
  --text: #e8efe9;
  --muted: #8fa39a;
  --border: #26362e;
  --good: #4ade80;
  --shadow: 0 12px 40px -12px rgba(0,0,0,.6);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(900px circle at 15% -5%, rgba(63,174,122,.14), transparent 55%),
    radial-gradient(700px circle at 90% 10%, rgba(47,143,176,.12), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 20px;
  -webkit-font-smoothing: antialiased;
}
.wrap { width: 100%; max-width: 560px; animation: rise .4s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
header { text-align: center; margin-bottom: 32px; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.6px; }
.brand-dot { color: var(--accent); }
.sub { color: var(--muted); margin-top: 8px; font-size: 15px; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 18px;
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  background: linear-gradient(180deg, var(--card), rgba(20,32,27,.6));
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  background: var(--card2);
  transform: translateY(-1px);
}
.dz-icon { width: 42px; height: 42px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 14px; }
.dz-inner p { color: var(--muted); font-size: 15px; margin: 4px 0; }
.dz-inner strong { color: var(--text); }
.browse { color: var(--accent); text-decoration: underline; }
.hint { font-size: 13px; opacity: .8; }

.file-list { list-style: none; margin: 16px 0 0; }
.file-list li {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; font-size: 14px;
}
.file-list .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.file-list .fsize { color: var(--muted); font-size: 13px; }
.file-list .remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.file-list .remove:hover { color: #ff6b6b; }

.btn {
  display: block; width: 100%; margin-top: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; border-radius: 12px;
  padding: 15px; font-size: 16px; font-weight: 600; cursor: pointer;
  transition: filter .2s, transform .1s, box-shadow .2s;
  box-shadow: 0 8px 20px -8px rgba(63,174,122,.5);
}
.btn:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 10px 26px -8px rgba(63,174,122,.65); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.btn.ghost:hover { background: var(--card2); }
.btn.download { text-decoration: none; text-align: center; }

.progress-wrap { margin-top: 20px; display: flex; align-items: center; gap: 12px; }
.progress-bar { flex: 1; height: 8px; background: var(--card2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .15s; }
#progressText { font-size: 13px; color: var(--muted); min-width: 38px; text-align: right; }

.result { margin-top: 24px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.result-label { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.link-row { display: flex; gap: 8px; }
.link-row input {
  flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 12px; font-size: 14px; font-family: monospace;
}
.copy-btn {
  background: var(--card2); border: 1px solid var(--border); border-radius: 10px;
  width: 46px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.copy-btn:hover { background: var(--accent); }
.copy-btn.copied { background: var(--good); border-color: var(--good); }
.copy-icon { width: 18px; height: 18px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* View / download page */
.card { background: linear-gradient(180deg, var(--card), rgba(20,32,27,.7)); border: 1px solid var(--border); border-radius: 22px; padding: 40px 30px; text-align: center; box-shadow: var(--shadow); }
.file-icon { font-size: 54px; margin-bottom: 14px; }
.file-name { font-size: 20px; word-break: break-all; margin-bottom: 24px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 12px; margin-bottom: 20px; }
.meta-item { background: var(--card2); border-radius: 12px; padding: 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.meta-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.meta-val { font-size: 15px; font-weight: 600; }
.contents { text-align: left; background: var(--card2); border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; }
.contents summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.contents ul { list-style: none; margin-top: 10px; }
.contents li { font-size: 14px; padding: 4px 0; border-bottom: 1px solid var(--border); word-break: break-all; }
.contents li:last-child { border-bottom: none; }
.footer-note { text-align: center; margin-top: 20px; }
.footer-note a { color: var(--accent); text-decoration: none; font-size: 14px; }

/* PIN gate */
.pin-card { max-width: 360px; margin: 40px auto 0; }
.pin-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.pin-input {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; padding: 14px; font-size: 24px; text-align: center;
  letter-spacing: 8px; font-family: monospace;
}
.pin-input:focus { outline: none; border-color: var(--accent); }
.pin-err { color: #ff6b6b; font-size: 14px; margin-bottom: 12px; }

/* Archive name field */
.name-wrap { margin-top: 16px; animation: rise .25s ease both; }
.name-wrap label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.name-wrap .opt { opacity: .7; font-size: 13px; }
.name-input-row {
  display: flex; align-items: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 0 14px; transition: border-color .2s;
}
.name-input-row:focus-within { border-color: var(--accent); }
.name-input-row input {
  flex: 1; background: none; border: none; color: var(--text);
  padding: 13px 0; font-size: 15px; outline: none;
}
.name-input-row .ext { color: var(--muted); font-size: 15px; font-family: monospace; }

/* Error page */
.error-card { max-width: 420px; margin: 40px auto 0; }
.error-msg { color: var(--muted); font-size: 15px; margin-bottom: 24px; line-height: 1.5; }
