/* SafeDigits - Professional Dark Theme with Cyan Accents (SC-USCS Style) */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2234;
  --bg-card: #151d2e;
  --bg-card-hover: #1c2640;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #06b6d4;
  --accent-secondary: #0ea5e9;
  --accent-glow: rgba(6, 182, 212, 0.4);
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --border-color: #2d3a52;
  --border-light: #374463;
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --container-max: 1200px;
  --section-padding: 6rem;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --border-radius-sm: 8px;
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px var(--accent-glow);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Effects */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(rgba(6, 182, 212, 0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(6, 182, 212, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: -2;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
}

.bg-glow-1 {
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
  animation: float 20s ease-in-out infinite;
}

.bg-glow-2 {
  bottom: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(20px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(30px, 10px) scale(1.02); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  width: 40px;
  height: 40px;
  color: var(--accent-primary);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-name {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.logo-version {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--accent-primary);
  background: rgba(6, 182, 212, 0.1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--bg-primary);
  box-shadow: var(--shadow-sm), 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 30px var(--accent-glow);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Hero Section */
.hero {
  padding: calc(72px + 4rem) 0 4rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  max-width: 600px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 100px;
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease;
}

.hero-badge svg {
  width: 16px;
  height: 16px;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-title-line {
  display: block;
}

.hero-title-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-description strong {
  color: var(--text-primary);
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-cta {
  display: flex;
  gap: 1rem;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.hero-visual {
  animation: fadeInUp 0.8s ease 0.3s both;
}

/* Terminal Preview */
.terminal {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.terminal-dots {
  display: flex;
  gap: 8px;
}

.terminal-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: #ef4444; }
.terminal-dots span:nth-child(2) { background: #f59e0b; }
.terminal-dots span:nth-child(3) { background: #10b981; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
}

.terminal-body .code-comment { color: #6b7280; }
.terminal-body .code-key { color: var(--accent-primary); }
.terminal-body .code-value { color: var(--success); }

/* Sections */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.section-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Features Section */
.features-section {
  padding: var(--section-padding) 0;
  background: var(--bg-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  transition: all var(--transition-base);
}

.feature-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(6, 182, 212, 0.15);
}

.feature-icon {
  width: 56px;
  height: 56px;
  background: rgba(6, 182, 212, 0.1);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--accent-primary);
}

.feature-icon svg {
  width: 28px;
  height: 28px;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* How It Works */
.how-it-works {
  padding: var(--section-padding) 0;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.step {
  text-align: center;
  padding: 2rem;
}

.step-number {
  width: 64px;
  height: 64px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--bg-primary);
  margin: 0 auto 1.5rem;
  box-shadow: var(--shadow-glow);
}

.step h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.step p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Card Form (Generate/Decode Pages) */
.page-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 3rem;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

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

.card-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-header p {
  color: var(--text-secondary);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

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

.form-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Radio Options */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-option {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.radio-option:hover {
  border-color: var(--border-light);
}

.radio-option.selected {
  border-color: var(--accent-primary);
  background: rgba(6, 182, 212, 0.05);
}

.radio-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.radio-label input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.radio-text strong {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--text-primary);
}

.radio-text span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Section Box */
.section-box {
  background: rgba(6, 182, 212, 0.03);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.section-box .form-label {
  margin-bottom: 1rem;
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-box .radio-group {
  margin-bottom: 0;
}

.section-box .form-group {
  margin-bottom: 0;
}

.section-box .captcha-box {
  margin-bottom: 0;
}

.section-box .form-input {
  margin-top: 0.75rem;
}

.section-box .captcha-box {
  margin-bottom: 0;
}

.section-box .form-input {
  margin-top: 0.75rem;
}

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

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

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

.alert-info {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
}

/* Progress Bar */
.progress-container {
  margin-bottom: 1.5rem;
}

.progress-bar-wrapper {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Result Display */
.result {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.result-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.result-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: var(--border-radius-sm);
  word-break: break-all;
  line-height: 1.6;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

.result-phone {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding: 1rem 0;
  text-align: center;
  letter-spacing: 1px;
}

.result-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.result-actions .btn {
  flex: 1;
  min-width: 120px;
}

.result-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.footer-brand .logo {
  margin-bottom: 0.75rem;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 300px;
}

.footer-links {
  display: flex;
  gap: 4rem;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-disclaimer {
  margin-top: 1rem;
  font-size: 0.8rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Simple Footer (for sub-pages) */
.footer-simple {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-simple a {
  color: var(--accent-primary);
  text-decoration: none;
}

.footer-simple a:hover {
  text-decoration: underline;
}

/* Utility */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .hero-visual {
    max-width: 600px;
    margin: 0 auto;
  }
  .steps-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 4rem;
  }
  .container {
    padding: 0 1.25rem;
  }
  .nav, .header-actions {
    display: none;
  }
  .hero {
    padding-top: calc(72px + 2rem);
    min-height: auto;
  }
  .hero-stats {
    flex-wrap: wrap;
    gap: 1.5rem;
  }
  .hero-cta {
    flex-direction: column;
  }
  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }
  .page-card {
    padding: 2rem 1.5rem;
  }
  .result-actions {
    flex-direction: column;
  }
  .result-actions .btn {
    width: 100%;
  }
  .footer-content {
    flex-direction: column;
  }
  .footer-links {
    flex-direction: column;
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  .stat-value {
    font-size: 1.5rem;
  }
  .result-phone {
    font-size: 1.4rem;
  }
}

/* Human Verification (Captcha) */
.captcha-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
}

.captcha-question {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.captcha-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.captcha-refresh:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.captcha-refresh:active {
  transform: scale(0.95);
}
