/* ─── Design Tokens (Light) ─────────────────────────────────────────── */
:root {
  --bg-primary:    #ffffff;
  --bg-secondary:  #f7f8fa;
  --bg-tertiary:   #eef0f4;
  --text-primary:  #111827;
  --text-secondary:#6b7280;
  --text-muted:    #9ca3af;
  --border:        #e5e7eb;
  --border-focus:  #3b82f6;
  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --accent-light:  #eff6ff;
  --success:       #059669;
  --success-light: #ecfdf5;
  --success-border:#a7f3d0;
  --warning:       #b45309;
  --warning-light: #fffbeb;
  --warning-border:#fcd34d;
  --error:         #dc2626;
  --error-light:   #fef2f2;
  --error-border:  #fca5a5;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 12px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --header-height: 60px;
}

/* ─── Dark mode: JS toggle ──────────────────────────────────────────── */
html[data-theme="dark"] {
  --bg-primary:    #0f1117;
  --bg-secondary:  #1a1d27;
  --bg-tertiary:   #252837;
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;
  --border:        #2e3347;
  --border-focus:  #60a5fa;
  --accent:        #3b82f6;
  --accent-hover:  #2563eb;
  --accent-light:  #1e3a5f;
  --success:       #10b981;
  --success-light: #064e3b;
  --success-border:#065f46;
  --warning:       #f59e0b;
  --warning-light: #451a03;
  --warning-border:#92400e;
  --error:         #ef4444;
  --error-light:   #450a0a;
  --error-border:  #7f1d1d;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.35);
  --shadow-md:     0 4px 12px rgba(0,0,0,.40);
}

/* ─── Dark mode: system preference fallback ─────────────────────────── */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg-primary:    #0f1117;
    --bg-secondary:  #1a1d27;
    --bg-tertiary:   #252837;
    --text-primary:  #f1f5f9;
    --text-secondary:#94a3b8;
    --text-muted:    #64748b;
    --border:        #2e3347;
    --border-focus:  #60a5fa;
    --accent:        #3b82f6;
    --accent-hover:  #2563eb;
    --accent-light:  #1e3a5f;
    --success:       #10b981;
    --success-light: #064e3b;
    --success-border:#065f46;
    --warning:       #f59e0b;
    --warning-light: #451a03;
    --warning-border:#92400e;
    --error:         #ef4444;
    --error-light:   #450a0a;
    --error-border:  #7f1d1d;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.35);
    --shadow-md:     0 4px 12px rgba(0,0,0,.40);
  }
}

/* ─── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ─── Header ─────────────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo:hover { text-decoration: none; }

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ─── Theme Toggle ───────────────────────────────────────────────────── */
.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background-color 0.2s, border-color 0.2s;
  color: var(--text-primary);
  padding: 0;
}

.theme-toggle:hover { background: var(--bg-tertiary); }

/* ─── Layout ─────────────────────────────────────────────────────────── */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

main { flex: 1; padding: 2.5rem 0 3rem; }

/* ─── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.25rem;
  transition: border-color 0.2s, background-color 0.25s;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
  letter-spacing: -0.02em;
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ─── Trust Badges ───────────────────────────────────────────────────── */
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid transparent;
}

.badge-secure  { background: var(--accent-light);  color: var(--accent);  border-color: var(--border-focus); opacity: 0.85; }
.badge-delete  { background: var(--success-light); color: var(--success); border-color: var(--success-border); }
.badge-private { background: var(--bg-tertiary);   color: var(--text-secondary); border-color: var(--border); }

/* ─── Forms ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="datetime-local"],
textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.25s;
  box-sizing: border-box;
  min-height: 2.625rem;
}

input[type="file"] {
  width: 100%;
  padding: 0.5rem 0.875rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  box-sizing: border-box;
  min-height: 2.625rem;
}

input[type="file"]:hover {
  border-color: var(--accent);
  background-color: var(--accent-light);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}

textarea {
  resize: vertical;
  min-height: 140px;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
}

.field-hint {
  margin-top: 0.375rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
button, a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.625rem 1.375rem;
  background-color: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, transform 0.1s;
  white-space: nowrap;
  user-select: none;
}

button:hover, a.button:hover { background-color: var(--accent-hover); }
button:active, a.button:active { transform: scale(0.98); }
button:disabled { background-color: var(--text-muted); cursor: not-allowed; transform: none; }

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background-color: var(--border); }

.btn-success { background-color: var(--success); }
.btn-success:hover { filter: brightness(0.9); }

.button-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ─── Alert Boxes ────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.alert-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.1rem; }

.alert-success {
  background: var(--success-light);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.alert-warning {
  background: var(--warning-light);
  border: 1px solid var(--warning-border);
  color: var(--warning);
}

.alert-error {
  background: var(--error-light);
  border: 1px solid var(--error-border);
  color: var(--error);
}

/* Legacy – kept for any template still using these class names */
.success-box {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  background: var(--success-light);
  border: 1px solid var(--success-border);
  color: var(--success);
  font-size: 0.9rem;
}

.error-box {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  background: var(--error-light);
  border: 1px solid var(--error-border);
  color: var(--error);
  font-size: 0.9rem;
}

/* ─── Secret / URL display ───────────────────────────────────────────── */
.secret-box, .url-box {
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  word-break: break-all;
  white-space: pre-wrap;
  overflow-x: auto;
  color: var(--text-primary);
  margin: 1rem 0;
}

/* ─── File Info ──────────────────────────────────────────────────────── */
.file-info {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.file-info-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 0.875rem;
}

/* ─── Numbered steps list ────────────────────────────────────────────── */
.steps {
  counter-reset: step;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.2rem;
}

/* ─── Security Info ──────────────────────────────────────────────────── */
.security-info {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.security-info-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.security-info ul {
  margin-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.security-info p { margin: 0; }

/* ─── Typography ─────────────────────────────────────────────────────── */
h1 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.3rem; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }

.small-text { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.3rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Footer ─────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  background: var(--bg-secondary);
  transition: background-color 0.25s, border-color 0.25s;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  main { padding: 1.5rem 0 2rem; }
  .card { padding: 1.25rem; border-radius: var(--radius-md); }
  h2 { font-size: 1.05rem; }
  .button-group { flex-direction: column; }
  .button-group button,
  .button-group a.button,
  .button-group form { width: 100%; }
  .button-group form button { width: 100%; }
  .file-meta { flex-direction: column; gap: 0.2rem; }
  .trust-badges { gap: 0.375rem; }
}
