:root {
  --bg: #0f1116;
  --panel: #171a21;
  --panel-2: #1e222b;
  --line: #2a2f3a;
  --text: #e8ebf0;
  --muted: #98a0ae;
  --accent: #f81d45;
  --accent-dim: #b31533;
  --ok: #34c77b;
  --warn: #f0a92e;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 4rem;
}

header { text-align: center; margin-bottom: 1.75rem; }

.brand {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.brand span { color: var(--accent); }

.tagline { color: var(--muted); margin: .35rem 0 0; font-size: .95rem; }

main {
  width: 100%;
  max-width: 620px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

h2 { margin: 0 0 .35rem; font-size: 1.15rem; }
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }

label { display: block; font-weight: 600; font-size: .9rem; margin: 1.1rem 0 .4rem; }

textarea, input[type="text"], input[type="password"], select {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem .8rem;
  font: inherit;
  font-size: .95rem;
}
textarea { min-height: 150px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent-dim); border-color: transparent; }

button {
  width: 100%;
  margin-top: 1.25rem;
  padding: .85rem 1rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--accent-dim); }
button:disabled { opacity: .55; cursor: not-allowed; }

button.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
button.secondary:hover:not(:disabled) { background: var(--line); }

.row { display: flex; gap: .75rem; align-items: center; }
.row > * { flex: 1; }

.check { display: flex; align-items: center; gap: .55rem; margin-top: 1.1rem; }
.check input { width: auto; flex: 0; }
.check label { margin: 0; font-weight: 500; }

/* link/result blocks */
.field {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem .8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  word-break: break-all;
  user-select: all;
}

.note {
  border-left: 3px solid var(--warn);
  background: rgba(240, 169, 46, .07);
  padding: .7rem .9rem;
  border-radius: 0 8px 8px 0;
  font-size: .88rem;
  color: #e6d3ae;
  margin-top: .6rem;
}
.note.danger { border-left-color: var(--accent); background: rgba(248, 29, 69, .07); color: #f0c2cc; }
.note.ok     { border-left-color: var(--ok);     background: rgba(52, 199, 123, .07); color: #bfe9d4; }

.secret-out {
  background: #0b0d11;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92rem;
  max-height: 40vh;
  overflow: auto;
}

.big-state { text-align: center; padding: 1.25rem 0; }
.big-state .icon { font-size: 2.6rem; line-height: 1; }
.big-state h2 { margin-top: .6rem; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

footer {
  margin-top: 2rem;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
  max-width: 620px;
}
footer a { color: var(--muted); }

.spinner {
  display: inline-block;
  width: 1em; height: 1em;
  border: 2px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -.15em;
  margin-right: .5em;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* passphrase field + reveal toggle */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 2.9rem; }
.pw-toggle {
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.2rem;
  margin: 0;
  padding: .3rem;
  background: transparent;
  border: 0;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  opacity: .75;
}
.pw-toggle:hover { background: transparent; opacity: 1; }

/* live size counter under the textarea */
.counter {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--muted);
  margin-top: .35rem;
}
.counter.over { color: var(--accent); font-weight: 600; }

.linkrow { text-align: center; margin-top: 1.25rem; }
.linkrow a { color: var(--accent); text-decoration: none; font-weight: 600; }
.linkrow a:hover { text-decoration: underline; }
