:root{
  --bg:#0b1220;
  --panel:#0f1b33;
  --panel2:#0d172c;
  --text:#e7eefc;
  --muted:#a9b7d0;
  --accent:#66e3ff;
  --accent2:#7c5cff;
  --danger:#ff5c7a;
  --ok:#44f1a6;
  --border:rgba(255,255,255,.08);
  --shadow: 0 16px 50px rgba(0,0,0,.45);
  --radius: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:var(--sans);
  background:
    radial-gradient(1200px 700px at 15% 20%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(900px 600px at 90% 30%, rgba(102,227,255,.18), transparent 55%),
    linear-gradient(180deg, var(--bg), #060a14 80%);
  color:var(--text);
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
}

.wrap{width:min(980px, 100%)}

/* ---------- Hero / Header ---------- */
.hero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}

.title{
  font-size: clamp(24px, 3vw, 34px);
  font-weight:800;
  letter-spacing:-.02em;
  margin:0;
}

.subtitle{
  margin:6px 0 0;
  color:var(--muted);
  line-height:1.45;
  max-width:70ch;
  font-size:14px;
}

/* Small “tech badge” used on password page */
.badge{
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  padding:10px 12px;
  border-radius:999px;
  color:var(--muted);
  font-size:12px;
  display:flex;
  gap:8px;
  align-items:center;
  white-space:nowrap;
}

.dot{
  width:8px;height:8px;border-radius:50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 18px rgba(102,227,255,.35);
}

/* Back button */
.back-link{
  display:inline-block;
  margin-bottom:8px;
  font-size:13px;
  font-weight:600;
  text-decoration:none;
  color:var(--muted);
  border:1px solid var(--border);
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.04);
  transition: filter .12s ease, transform .08s ease;
}
.back-link:hover{filter:brightness(1.1)}
.back-link:active{transform:translateY(1px)}

/* ---------- Cards ---------- */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow:hidden;
}

.head{
  padding:16px 18px;
  border-bottom:1px solid var(--border);
  background: rgba(0,0,0,.15);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.head h2{
  font-size:14px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:var(--muted);
  margin:0;
}

.body{padding:16px 18px}

/* Pill label used in header corners */
.pill{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  white-space:nowrap;
}

/* ---------- Layout helpers ---------- */
.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:16px;
}

@media (min-width: 880px){
  .grid{grid-template-columns: 1fr 1fr;}
}

.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:10px;
}

/* ---------- Inputs ---------- */
label{
  display:block;
  font-size:13px;
  color:var(--muted);
  margin:0 0 8px;
}

/* Password page uses password inputs; save page uses file input */
input[type="password"], input[type="text"]{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.22);
  color:var(--text);
  outline:none;
  font-size:14px;
}

input[type="password"]::placeholder,
input[type="text"]::placeholder{
  color:rgba(169,183,208,.6);
}

input[type="file"]{
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px dashed var(--border);
  background: rgba(0,0,0,.18);
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn{
  border:1px solid var(--border);
  background: linear-gradient(135deg, rgba(102,227,255,.16), rgba(124,92,255,.14));
  color: var(--text);
  padding:11px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:650;
  font-size:14px;
  text-decoration:none;
  transition: transform .08s ease, filter .12s ease;
  user-select:none;
}

.btn:hover{filter:brightness(1.08)}
.btn:active{transform: translateY(1px)}

.btn.secondary{
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-weight:600;
}

/* ---------- Output / Notes ---------- */
.note{
  font-size:12px;
  color: var(--muted);
  line-height:1.45;
  margin-top:10px;
}

.out{
  width:100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.22);
  color: var(--text);
  padding: 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.45;
  overflow:auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Save page wants a taller output area */
.out.tall{
  min-height: 320px;
  white-space: pre; /* nicer for pretty JSON */
  word-break: normal;
}

/* ---------- Alerts ---------- */
.alert{
  border-radius: 14px;
  border: 1px solid rgba(255,92,122,.35);
  background: rgba(255,92,122,.10);
  color: #ffd2da;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.warn{
  border-radius: 14px;
  border: 1px solid rgba(255,227,102,.35);
  background: rgba(255,227,102,.10);
  color: #fff0c2;
  padding: 12px 14px;
  margin-bottom: 14px;
}

/* ---------- Footer ---------- */
.footer{
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align:center;
}
