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

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --warning-bg: #fef3c7;
  --warning-border: #f59e0b;
  --success: #16a34a;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
}

h1 a {
  color: inherit;
  text-decoration: none;
}

h1 a:hover {
  opacity: 0.8;
}

.logo {
  width: 160px;
  height: auto;
  display: block;
  margin: 0 0 12px;
}

a .logo {
  display: block;
}

.subtitle {
  color: var(--text-muted);
  margin: 0 0 32px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
}

textarea, select, input[type="text"], input[type="password"] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  transition: border-color 0.2s;
}

textarea:focus, select:focus, input[type="text"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
}

textarea {
  resize: vertical;
  min-height: 150px;
}

.char-count {
  text-align: right;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

button {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s;
}

button[type="submit"], button.primary, #copy-btn, #copy-secret-btn {
  background: var(--primary);
  color: white;
}

button[type="submit"]:hover, button.primary:hover, #copy-btn:hover, #copy-secret-btn:hover {
  background: var(--primary-hover);
}

button[type="submit"]:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

button.secondary, #new-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

button.secondary:hover, #new-btn:hover {
  background: var(--bg);
}

.result {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.result h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.warning {
  color: var(--danger);
  font-size: 0.875rem;
  margin: 0 0 16px;
}

.link-container {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.link-container input {
  flex: 1;
  font-family: monospace;
  font-size: 0.875rem;
}

.copied-msg {
  color: var(--success);
  font-size: 0.875rem;
  margin: 8px 0;
}

.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  padding: 16px;
  border-radius: var(--radius);
  margin-top: 16px;
}

.error h2 {
  margin: 0 0 8px;
  font-size: 1.125rem;
}

.error p {
  margin: 0 0 16px;
}

.error .btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
}

.hidden {
  display: none !important;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.secret-container {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.warning-banner {
  background: var(--warning-bg);
  border-bottom: 1px solid var(--warning-border);
  padding: 12px 16px;
  font-size: 0.875rem;
}

.secret-content {
  padding: 24px;
  background: #1e293b;
}

.secret-content pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.9rem;
  color: #e2e8f0;
  max-height: 400px;
  overflow-y: auto;
}

#copy-secret-btn {
  margin: 16px;
}

footer {
  text-align: center;
  padding: 32px 0 16px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

footer a {
  color: var(--primary);
}

.checkbox-group {
  margin-bottom: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

#password-group label {
  margin-top: 12px;
}

#password-group label:first-child {
  margin-top: 0;
}

.password-field {
  position: relative;
}

.password-field input[type="password"],
.password-field input[type="text"] {
  padding-right: 44px;
}

.toggle-visibility {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
}

.toggle-visibility:hover {
  opacity: 0.8;
}

.hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 8px 0 0;
}

.password-note {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.875rem;
}

.password-form {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}

.password-form h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.password-form p {
  color: var(--text-muted);
  margin: 0 0 20px;
}

.password-form .form-group {
  text-align: left;
}

.password-form button {
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .link-container { flex-direction: column; }
}