:root {
  --bg: #050805;
  --bg-grid: rgba(0, 255, 100, 0.03);
  --card: #0a120c;
  --border: #1a3d24;
  --border-bright: #2d6b3f;
  --text: #b8f5c8;
  --muted: #4d8a5e;
  --accent: #22c55e;
  --accent-dim: #16a34a;
  --accent-glow: rgba(34, 197, 94, 0.35);
  --accent-hover: #4ade80;
  --success: #4ade80;
  --warn: #eab308;
  --error: #f87171;
  --radius: 4px;
  --font: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, 'Consolas', monospace;
  --scanline: rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 0%, rgba(34, 197, 94, 0.08), transparent 55%);
  background-size: 24px 24px, 24px 24px, 100% 80%;
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  padding: 24px 16px;
  position: relative;
}

/* Subtle CRT scanlines */
body::before {
  content: '';
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--scanline) 2px,
    var(--scanline) 4px
  );
  z-index: 9999;
  opacity: 0.4;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

header h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-shadow:
    0 0 12px var(--accent-glow),
    0 0 28px rgba(34, 197, 94, 0.2);
}

header h1::before {
  content: '> ';
  color: var(--muted);
  text-shadow: none;
  font-weight: 500;
}

header .subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

header .subtitle::before {
  content: '// ';
  opacity: 0.7;
}

.star-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.star-hint a {
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px var(--accent-glow);
  transition: background 0.15s, box-shadow 0.15s;
}

.star-hint a:hover {
  background: rgba(34, 197, 94, 0.15);
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.2);
  color: var(--accent-hover);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.1);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px 12px;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.lang-btn:hover {
  color: var(--accent);
  background: rgba(34, 197, 94, 0.08);
}

.lang-btn.active {
  background: rgba(34, 197, 94, 0.18);
  color: var(--accent);
  box-shadow: inset 0 0 12px rgba(34, 197, 94, 0.15);
  text-shadow: 0 0 8px var(--accent-glow);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.45);
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
  opacity: 0.5;
}

.card h2 {
  font-size: 0.95rem;
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: none;
}

.card h2::before {
  content: '$ ';
  color: var(--muted);
  font-weight: 500;
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

input[type="file"],
input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: #030604;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  margin-bottom: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  caret-color: var(--accent);
}

input[type="file"] {
  color: var(--muted);
}

input[type="file"]::file-selector-button {
  font-family: var(--font);
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid var(--border-bright);
  color: var(--accent);
  border-radius: var(--radius);
  padding: 6px 12px;
  margin-right: 12px;
  cursor: pointer;
  font-size: 0.8rem;
}

input[type="file"]::file-selector-button:hover {
  background: rgba(34, 197, 94, 0.22);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25), 0 0 16px rgba(34, 197, 94, 0.08);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234d8a5e' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

select option {
  background: #0a120c;
  color: var(--text);
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.checkbox-row input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s, color 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  width: 100%;
  text-shadow: 0 0 8px var(--accent-glow);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.1);
}

.btn-primary:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.28);
  border-color: var(--accent);
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.22);
  color: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.45);
  width: 100%;
  margin-top: 10px;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.1);
  box-shadow: 0 0 16px rgba(248, 113, 113, 0.12);
}

.btn-danger:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.status {
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-top: 12px;
  border: 1px solid transparent;
  font-family: var(--font);
}

.status.info {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.25);
  color: #86efac;
}

.status.success {
  background: rgba(74, 222, 128, 0.1);
  border-color: rgba(74, 222, 128, 0.4);
  color: var(--success);
  text-shadow: 0 0 10px var(--accent-glow);
}

.status.warn {
  background: rgba(234, 179, 8, 0.08);
  border-color: rgba(234, 179, 8, 0.35);
  color: #fde047;
}

.status.error {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

#file-info {
  font-size: 0.8rem;
  color: var(--accent-dim);
  margin-top: -8px;
  margin-bottom: 12px;
}

#file-info:not(:empty)::before {
  content: '[ok] ';
  color: var(--accent);
}

#speed {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
  letter-spacing: 0.04em;
}

#speed:not(:empty)::before {
  content: '▸ ';
  color: var(--accent-dim);
}

.success-box {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: 0 0 32px rgba(34, 197, 94, 0.12);
}

.success-box h3 {
  color: var(--success);
  margin-bottom: 12px;
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px var(--accent-glow);
}

.password,
.password-copy {
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 700;
  background: #030604;
  border: 1px dashed var(--border-bright);
  padding: 14px 16px;
  border-radius: var(--radius);
  word-break: break-all;
  margin: 12px 0;
  color: var(--success);
  text-shadow: 0 0 10px var(--accent-glow);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.password-copy:hover {
  border-color: var(--accent);
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.15);
}

.password-copy:active {
  transform: scale(0.99);
}

.password-value {
  user-select: all;
}

.password-copy-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-shadow: none;
  letter-spacing: 0.04em;
}

.password-copy-hint.copied {
  color: var(--success);
  text-shadow: 0 0 8px var(--accent-glow);
}

.btn-export {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-bright);
  width: 100%;
  margin: 4px 0 12px;
  text-shadow: 0 0 8px var(--accent-glow);
}

.btn-export:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.12);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.15);
  color: var(--accent-hover);
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
}

footer {
  text-align: center;
  margin-top: 40px;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
}

.footer-links .sep {
  color: var(--border-bright);
  opacity: 0.8;
}

footer a {
  color: var(--accent);
  text-decoration: none;
  text-shadow: 0 0 6px var(--accent-glow);
}

footer a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.55;
}

@media (max-width: 520px) {
  .row {
    grid-template-columns: 1fr;
  }

  header h1 {
    font-size: 1.25rem;
  }
}

/* Reduce motion / heavy effects if preferred */
@media (prefers-reduced-motion: reduce) {
  body::before {
    display: none;
  }
}
