/* Secret-Pass Design System - Vault Minimal */

/* === CSS Custom Properties === */
:root {
  /* Colors */
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1a1a1a;
  --bg-overlay: rgba(0, 0, 0, 0.8);

  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(255, 255, 255, 0.2);

  --text-primary: #e5e5e5;
  --text-secondary: #a3a3a3;
  --text-muted: #525252;

  --accent: #22d3ee;
  --accent-hover: #67e8f9;
  --accent-muted: rgba(34, 211, 238, 0.15);
  --accent-glow: rgba(34, 211, 238, 0.3);

  --success: #4ade80;
  --error: #f87171;

  /* Typography */
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Geist Mono', 'SF Mono', 'Consolas', monospace;

  /* Spacing (4px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Sizing */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.25, 1, 0.5, 1);
  --transition-normal: 200ms cubic-bezier(0.25, 1, 0.5, 1);
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background atmosphere - noise texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: -1;
}

/* Background atmosphere - vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 0%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
  z-index: -1;
}

/* === Layout === */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-4);
}

.content {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
}

/* === Typography === */
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.logo:hover {
  color: var(--accent);
}

.logo-icon {
  transition: all var(--transition-fast);
}

.logo:hover .logo-icon {
  stroke: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: 24px; }
h4 { font-size: 16px; margin-bottom: var(--space-3); }

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.mono {
  font-family: var(--font-mono);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.btn-primary {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-muted);
  border-color: var(--accent-hover);
  color: var(--accent-hover);
  box-shadow: 0 0 24px -4px var(--accent-glow);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 0 16px -4px var(--accent-glow);
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent-glow);
}

.btn-secondary {
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-secondary);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: 16px;
}

/* === Form Inputs === */
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.input::placeholder {
  color: var(--text-secondary);
}

.input:hover:not(:disabled) {
  border-color: var(--border-hover);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-muted),
    0 0 24px -8px var(--accent-glow);
}

.input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.input-lg {
  padding: var(--space-4);
  font-size: 16px;
}

/* === Output Display === */
.output {
  position: relative;
  width: 100%;
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-secondary);
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  word-break: break-all;
  user-select: all;
  min-height: 44px;
  text-align: center;
}

/* Corner brackets for "secure container" feel */
.output::before,
.output::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-style: solid;
  border-color: var(--accent);
  opacity: 0.4;
  pointer-events: none;
}

.output::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
  border-radius: 4px 0 0 0;
}

.output::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 4px 0;
}

.output:empty::before {
  content: '\200B'; /* Zero-width space to maintain height */
  position: static;
  border: none;
}

/* === Info Drawer === */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: 200;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 90vw);
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  z-index: 201;
  display: flex;
  flex-direction: column;
}

.drawer-overlay.open + .drawer,
.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: flex-end;
  padding: var(--space-4);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}

.drawer-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.drawer-close:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.drawer-close svg {
  width: 16px;
  height: 16px;
}

.drawer-body {
  flex: 1;
  padding: var(--space-6);
  overflow-y: auto;
}

.drawer-body ol {
  padding-left: var(--space-5);
  margin-bottom: var(--space-6);
}

.drawer-body li {
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  line-height: 1.6;
}

.drawer-body p {
  margin-bottom: var(--space-4);
}

/* === 404 Page === */
.error-page {
  text-align: center;
}

.error-icon {
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  opacity: 0.6;
}

.error-code {
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-muted) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--space-4);
}

.error-text {
  color: var(--text-secondary);
}

/* === Animations === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered reveal animation for content children */
.content > * {
  opacity: 0;
  animation: fadeInUp 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.content > *:nth-child(1) { animation-delay: 0ms; }
.content > *:nth-child(2) { animation-delay: 100ms; }
.content > *:nth-child(3) { animation-delay: 200ms; }

.fade-in {
  animation: fadeInUp 0.3s ease-out forwards;
}

/* === Responsive === */
@media (max-width: 480px) {
  .header {
    padding: var(--space-3);
  }

  .content {
    gap: var(--space-5);
  }

  .btn-lg {
    width: 100%;
  }

  .input {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}
