:root {
  --bg: #0f1117;
  --card: #181b24;
  --card-border: #262a36;
  --text: #e6e8ee;
  --muted: #9aa0ad;
  --accent: #4f8cff;
  --accent-hover: #3d77e6;
  --ok: #2ecc71;
  --error: #ff6b6b;
  --input-bg: #11141b;
  --radius: 12px;
}

* { box-sizing: border-box; }

/* A class-level `display` (e.g. .stack { display:flex }) otherwise overrides the
   browser's default [hidden]{display:none}, leaving "hidden" sections visible. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2030 0%, var(--bg) 60%);
  color: var(--text);
}

.card {
  width: 100%;
  max-width: 780px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.head {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--card-border);
}
.head-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.title-group { display: flex; align-items: center; gap: 0.6rem; }
.logo-link { flex: none; display: flex; line-height: 0; opacity: 1; transition: opacity 0.15s; }
.logo-link:hover { opacity: 0.75; }
.logo { height: 30px; width: auto; display: block; }
h1 { margin: 0; font-size: 1.45rem; letter-spacing: -0.01em; }
.sub { margin: 0; color: var(--muted); line-height: 1.5; }
.muted { color: var(--muted); }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.45rem; }

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  font-weight: 600;
}
.counter { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.hint { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }

textarea, input[type="text"], input[type="password"] {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.15s;
}
textarea:focus, input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Secret input + output share a monospace face (matches .content-box). */
#content {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  min-height: 240px;
}

.btn {
  appearance: none;
  border: 1px solid var(--card-border);
  background: #222634;
  color: var(--text);
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: #2a2f40; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; }
.btn.copied { background: var(--ok); border-color: var(--ok); color: #06210f; }

.copy-row { display: flex; gap: 0.5rem; }
.copy-row input { flex: 1; }

.ok-banner {
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.4);
  color: #7ee2a8;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.gone-banner {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ff9b9b;
  padding: 0.9rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.content-box {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.9rem;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  min-height: 240px;
  max-height: 65vh;
  overflow: auto;
}

.error { color: var(--error); font-size: 0.88rem; margin: 0; }
.foot {
  color: var(--muted);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.lang-switch { display: inline-flex; gap: 0.15rem; }
.lang-btn {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { color: var(--text); font-weight: 700; background: rgba(255, 255, 255, 0.06); }

/* Info button + modal */
.info-btn {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: #222634;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.info-btn:hover { background: #2a2f40; color: var(--text); border-color: var(--accent); }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}
.modal {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.modal h2 { margin: 0; font-size: 1.2rem; }
.modal h3 { margin: 1.25rem 0 0.4rem; font-size: 0.95rem; color: var(--accent); }
.modal p { margin: 0.6rem 0 0; color: var(--text); line-height: 1.55; }
.modal ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.modal li { margin: 0.35rem 0; color: var(--muted); line-height: 1.5; }
.modal li strong, .modal li em { color: var(--text); }
.modal-close {
  flex: none;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}
.modal-close:hover { color: var(--text); }
