/* ==========================================================================
   CloudSend — Swiss Industrial & Modern Utility Design System
   High-contrast, Editorial Aesthetic (Zero AI-cliché gradients)
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-canvas: #0b0c10;
  --bg-surface: #12141a;
  --bg-elevated: #181b22;
  --bg-muted: #1e222b;
  --bg-input: #111318;

  --border-dim: rgba(255, 255, 255, 0.07);
  --border-mid: rgba(255, 255, 255, 0.14);
  --border-bright: rgba(255, 255, 255, 0.28);

  --text-primary: #fcfbf9;
  --text-secondary: #9ea3b0;
  --text-tertiary: #606573;

  /* Signature Electric Solar Accent */
  --accent-base: #ff551f;
  --accent-hover: #ea4309;
  --accent-subtle: rgba(255, 85, 31, 0.12);
  --accent-border: rgba(255, 85, 31, 0.35);
  --accent-glow: rgba(255, 85, 31, 0.25);

  --status-live: #10b981;
  --status-live-bg: rgba(16, 185, 129, 0.1);
  --status-live-border: rgba(16, 185, 129, 0.25);

  --danger-base: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);

  --shadow-card: 0 16px 36px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border-dim);
  --shadow-elevated: 0 24px 48px -16px rgba(0, 0, 0, 0.85);

  --grid-pattern: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

[data-theme="light"] {
  --bg-canvas: #f6f4ee;
  --bg-surface: #ffffff;
  --bg-elevated: #fcfbfa;
  --bg-muted: #eae7de;
  --bg-input: #f2efe7;

  --border-dim: #e4e0d5;
  --border-mid: #cfcac0;
  --border-bright: #1b1e24;

  --text-primary: #121419;
  --text-secondary: #585d69;
  --text-tertiary: #848a97;

  /* Signature Electric Solar Accent for Light */
  --accent-base: #ea4812;
  --accent-hover: #d23b07;
  --accent-subtle: #fef0eb;
  --accent-border: #f9b8a3;
  --accent-glow: rgba(234, 72, 18, 0.18);

  --status-live: #059669;
  --status-live-bg: #ecfdf5;
  --status-live-border: #a7f3d0;

  --danger-base: #dc2626;
  --danger-bg: #fef2f2;

  --shadow-card: 0 12px 28px -10px rgba(28, 25, 23, 0.08), 0 0 0 1px var(--border-dim);
  --shadow-elevated: 0 20px 40px -15px rgba(28, 25, 23, 0.12);

  --grid-pattern: radial-gradient(#d6d1c4 1px, transparent 1px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: var(--grid-pattern);
  background-size: 24px 24px;
  background-position: center;
  transition: background-color 0.2s ease, color 0.2s ease;
  letter-spacing: -0.01em;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: -0.02em;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  transition: all 0.15s ease;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-dim);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-header .container {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.brand-badge-icon {
  width: 34px;
  height: 34px;
  background: var(--accent-base);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.brand-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  color: var(--text-secondary);
}

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

.nav-text-btn {
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  border: 1px solid transparent;
}

.nav-text-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
  border-color: var(--border-dim);
}

.theme-toggle-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--border-mid);
  transform: translateY(-1px);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 4rem 0 3.5rem;
  flex: 1 0 auto;
}

.hero-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.5rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  background: var(--status-live-bg);
  border: 1px solid var(--status-live-border);
  border-radius: 9999px;
  color: var(--status-live);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.25rem;
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

.hero-title span.accent-highlight {
  color: var(--accent-base);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Upload Terminal Box
   ========================================================================== */
.terminal-wrapper {
  max-width: 580px;
  margin: 0 auto;
}

.terminal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}

/* Top bar like a sleek developer utility */
.terminal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-dim);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

.terminal-indicator {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.terminal-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-live);
}

.terminal-body {
  padding: 1.75rem;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-mid);
  border-radius: 10px;
  padding: 2.75rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg-input);
  position: relative;
  transition: all 0.2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent-base);
  background: var(--accent-subtle);
  transform: scale(0.995);
}

.dropzone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.dropzone-icon-box {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-dim);
  color: var(--accent-base);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.dropzone:hover .dropzone-icon-box,
.dropzone.dragover .dropzone-icon-box {
  background: var(--accent-base);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px var(--accent-glow);
}

.dropzone-label-bold {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.dropzone-label-specs {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* File Selected Preview */
.file-selected-box {
  display: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  padding: 0.9rem 1.15rem;
  margin-bottom: 1.25rem;
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  overflow: hidden;
}

.file-badge-tag {
  padding: 0.25rem 0.55rem;
  background: var(--accent-subtle);
  color: var(--accent-base);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.file-name-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.file-bytes {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.file-delete-btn {
  background: transparent;
  color: var(--text-tertiary);
  padding: 0.4rem;
  border-radius: 6px;
}

.file-delete-btn:hover {
  color: var(--danger-base);
  background: var(--danger-bg);
}

/* Controls Grid */
.terminal-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0;
}

.control-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.control-select,
.control-input {
  background: var(--bg-input);
  border: 1px solid var(--border-dim);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
}

.control-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.control-select:focus,
.control-input:focus {
  border-color: var(--accent-base);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

/* Action Button */
.btn-action-primary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: var(--accent-base);
  color: #ffffff;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-action-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

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

/* Progress Terminal Box */
.terminal-progress {
  display: none;
  margin-top: 1.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  padding: 1rem;
}

.progress-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.progress-rail {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-meter {
  height: 100%;
  width: 0%;
  background: var(--accent-base);
  border-radius: 9999px;
  transition: width 0.15s ease;
}

/* Result / Complete */
.terminal-result {
  display: none;
  margin-top: 1.25rem;
  background: var(--status-live-bg);
  border: 1px solid var(--status-live-border);
  border-radius: 10px;
  padding: 1.25rem;
  animation: fadeIn 0.25s ease;
}

.result-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--status-live);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.result-input-group {
  display: flex;
  gap: 0.5rem;
}

.result-url-input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
}

.btn-copy-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-base);
  color: #ffffff;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.btn-copy-action:hover {
  background: var(--accent-hover);
}

.result-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.btn-restart-action {
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   Features Section (Industrial Utility Grid)
   ========================================================================== */
.features-section {
  padding: 4rem 0 5rem;
  border-top: 1px solid var(--border-dim);
}

.features-header {
  text-align: center;
  margin-bottom: 3rem;
}

.features-header-tag {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-base);
  margin-bottom: 0.4rem;
  display: inline-block;
}

.features-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.feature-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: 12px;
  padding: 1.75rem 1.25rem;
  position: relative;
  transition: all 0.2s ease;
}

.feature-box:hover {
  border-color: var(--border-mid);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.feature-idx {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
  display: block;
}

.feature-box h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text-primary);
}

.feature-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-dim);
  background: var(--bg-surface);
  padding: 2.25rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

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

.footer-nav a {
  color: var(--text-secondary);
  font-weight: 500;
}

.footer-nav a:hover {
  color: var(--text-primary);
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--status-live);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   Modal Dialog
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: 14px;
  width: 100%;
  max-width: 540px;
  padding: 1.85rem;
  box-shadow: var(--shadow-elevated);
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-title-text {
  font-size: 1.2rem;
  font-weight: 800;
}

.modal-close-trigger {
  background: transparent;
  color: var(--text-tertiary);
  padding: 0.25rem;
  border-radius: 6px;
}

.modal-close-trigger:hover {
  color: var(--text-primary);
}

.terminal-code-block {
  background: var(--bg-canvas);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  overflow-x: auto;
  margin: 1rem 0;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-anchor {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.toast-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border-mid);
  color: var(--text-primary);
  padding: 0.75rem 1.15rem;
  border-radius: 8px;
  box-shadow: var(--shadow-elevated);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideToast 0.2s ease, fadeToast 0.2s ease 2.75s forwards;
}

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

@keyframes fadeToast {
  to { opacity: 0; transform: translateY(6px); }
}

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

/* ==========================================================================
   404 & Legal Pages
   ========================================================================== */
.error-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5.5rem 1.5rem;
  flex: 1 0 auto;
}

.error-badge-huge {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent-base);
  margin-bottom: 1.25rem;
}

.error-main-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  max-width: 580px;
}

.error-text-desc {
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.legal-section-wrap {
  padding: 3.5rem 0 5rem;
  flex: 1 0 auto;
}

.legal-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: 14px;
  padding: 2.75rem;
  max-width: 820px;
  margin: 0 auto;
  box-shadow: var(--shadow-card);
}

.legal-sheet h1 {
  font-size: 1.85rem;
  font-weight: 900;
  margin-bottom: 0.25rem;
}

.legal-timestamp {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: 2rem;
}

.legal-sheet h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-base);
  margin: 1.75rem 0 0.5rem;
}

.legal-sheet p, .legal-sheet li {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 0.85rem;
}

.legal-sheet ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .brand-meta-chip {
    display: none;
  }

  .hero-title {
    font-size: 2.15rem;
  }

  .terminal-body {
    padding: 1.25rem;
  }

  .terminal-controls {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .legal-sheet {
    padding: 1.5rem;
  }
}
