:root {
  --bg: #ffffff;
  --surface: #f9fafb;
  --surface-hover: #f3f4f6;
  --border: #e5e7eb;
  --text: #111827;
  --text-secondary: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #059669;
  --success-bg: #d1fae5;
  --error: #dc2626;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 24px;
  flex: 1;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}

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

.nav-links a.active {
  color: var(--text);
  font-weight: 600;
}

.auth-slot {
  display: flex;
  align-items: center;
  min-width: 32px;
  min-height: 32px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

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

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--surface);
}

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

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* ---------- main layout ---------- */

.main-container {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 40px;
}

.deploy-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: start;
}

.deploy-main h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 0 28px;
}

.accent-text {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- card / form ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.url-field {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.url-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.url-field.invalid {
  border-color: var(--error);
}

.url-field.invalid:focus-within {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

#name-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  padding: 11px 0;
}

.url-suffix {
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.field-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.field-hint.error {
  color: var(--error);
}

.storage-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.storage-hint a {
  color: var(--accent);
  text-decoration: none;
}

.storage-hint a:hover {
  text-decoration: underline;
}

/* ---------- dropzone ---------- */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
  background: var(--bg);
}

.dropzone:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.dropzone:focus-visible {
  outline: none;
  border-color: var(--accent);
}

.dropzone.dragover {
  border-color: var(--accent);
  background: #eff6ff;
}

.dz-text {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--text);
  pointer-events: none;
}

.dz-text strong {
  color: var(--accent);
  font-weight: 500;
}

.dz-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  pointer-events: none;
}

/* ---------- file list ---------- */

.file-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.file-item:first-child {
  border-top: 1px solid var(--border);
}

.file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text);
}

.file-size {
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 12.5px;
}

.file-remove {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background 0.15s, color 0.15s;
}

.file-remove:hover {
  background: #fee2e2;
  color: var(--error);
}

/* ---------- status / success ---------- */

.form-status {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

.success-box {
  margin-top: 20px;
  padding: 16px;
  background: var(--success-bg);
  border-radius: 8px;
}

.success-text {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--success);
  font-weight: 500;
}

.success-url {
  color: #047857;
  font-weight: 600;
}

.success-actions {
  display: flex;
  gap: 8px;
}

.success-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: #065f46;
  opacity: 0.75;
}

/* ---------- sidebar ---------- */

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.sidebar-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 18px;
}

.sidebar-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sidebar-card-header h3 {
  margin: 0;
}

.sidebar-count {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.steps li {
  display: flex;
  gap: 12px;
}

.step-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
}

.steps strong {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.steps p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.empty-state {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.sidebar-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.sidebar-link:hover {
  text-decoration: underline;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.recent-item:last-child {
  border-bottom: none;
}

.recent-item-name {
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.recent-item-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--success);
  background: var(--success-bg);
  padding: 3px 8px;
  border-radius: 999px;
}

.recent-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.recent-item-delete {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.recent-item-delete:hover {
  background: #fee2e2;
  color: var(--error);
}

.ad-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ad-label {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.ad-slot {
  width: 300px;
  max-width: 100%;
  min-height: 250px;
  overflow: hidden;
}

/* ---------- features ---------- */

.features {
  margin-top: 72px;
  padding-top: 56px;
  border-top: 1px solid var(--border);
}

.features h2 {
  text-align: center;
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 40px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.feature-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px;
}

.feature-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* ---------- sub-page hero ---------- */

.page-hero {
  max-width: 640px;
  margin: 0 0 48px;
}

.page-hero h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.page-hero .subtitle {
  margin: 0;
}

/* ---------- detail steps (how it works) ---------- */

.detail-steps {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 720px;
  margin-bottom: 64px;
}

.detail-step {
  display: flex;
  gap: 20px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.detail-step:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.step-num.large {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--accent);
}

.detail-step h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 4px 0 8px;
}

.detail-step p {
  font-size: 14.5px;
  color: var(--text-secondary);
  margin: 0;
  max-width: 560px;
}

/* ---------- faq ---------- */

.faq {
  max-width: 720px;
  margin-bottom: 56px;
}

.faq h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 24px;
}

.faq-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h4 {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 6px;
}

.faq-item p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.faq-item a {
  color: var(--accent);
}

/* ---------- stat grid (limits) ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.stat-value {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.stat-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 4px 0 10px;
}

.stat-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.limits-footnote {
  max-width: 720px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0 0 48px;
}

.page-cta {
  margin-bottom: 24px;
}

/* ---------- manage page ---------- */

.manage-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 640px;
  margin-bottom: 48px;
}

.drop-card {
  padding: 24px;
}

.drop-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.drop-card-header h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.drop-card-header h3 a {
  color: var(--text);
  text-decoration: none;
}

.drop-card-header h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.add-file-row {
  margin-top: 14px;
}

.empty-state-block {
  max-width: 640px;
  margin-bottom: 48px;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .deploy-layout {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 600px) {
  .header-inner {
    gap: 16px;
  }

  .nav-links {
    display: none;
  }

  .main-container {
    padding: 36px 16px 32px;
  }

  .card {
    padding: 22px;
  }
}
