*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #b91c1c;
  --warning-bg: #fffbeb;
  --warning-border: #fcd34d;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

main {
  width: min(100%, 42rem);
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

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

.logo {
  display: inline-block;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.tagline {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

textarea,
input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  font: inherit;
  color: inherit;
  background: #fff;
}

textarea {
  min-height: 11rem;
  resize: vertical;
}

textarea:focus,
input[type="text"]:focus,
button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

button {
  border: 0;
  border-radius: 0.75rem;
  padding: 0.8rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.button-primary {
  width: 100%;
  margin-top: 1rem;
  background: var(--accent);
  color: #fff;
}

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

.button-secondary {
  background: #eef2ff;
  color: var(--accent);
}

.button-secondary:hover:not(:disabled) {
  background: #e0e7ff;
}

.result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.result-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.result-row input {
  flex: 1;
}

.hint,
.footer-note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.error {
  margin: 0;
  color: var(--danger);
  font-size: 0.95rem;
}

.warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 0.75rem;
  padding: 1rem;
  color: #92400e;
}

.secret-output {
  margin: 0;
  padding: 1rem;
  border-radius: 0.75rem;
  background: #111827;
  color: #f9fafb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

footer {
  margin-top: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
