/* ──────────────────────────────────────────────────────────────────────────────
   Design tokens
   ──────────────────────────────────────────────────────────────────────────── */
:root {
  --blue: #1a56db;
  --blue-dark: #1e429f;
  --blue-light: #eff6ff;
  --blue-mid: #3b82f6;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --red: #ef4444;
  --green: #10b981;
  --shadow: 0 4px 16px rgba(26, 86, 219, 0.10);
  --shadow-sm: 0 1px 4px rgba(26, 86, 219, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

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

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* ──────────────────────────────────────────────────────────────────────────────
   Navigation
   ──────────────────────────────────────────────────────────────────────────── */
.nav {
  background: var(--white);
  border-bottom: 3px solid var(--blue);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand {
  font-size: 20px;
  font-weight: 800;
  color: var(--blue);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-email {
  font-size: 13px;
  color: var(--gray-600);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────────────────────────
   Layout containers
   ──────────────────────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

.container-narrow {
  max-width: 480px;
  margin: 0 auto;
  padding: 64px 24px;
}

/* ──────────────────────────────────────────────────────────────────────────────
   Cards
   ──────────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  padding: 28px 32px;
  text-align: center;
}

.card-header .brand {
  font-size: 24px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
}

.card-header .tagline {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 4px;
}

.card-body {
  padding: 32px;
}

.card-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.card-section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ──────────────────────────────────────────────────────────────────────────────
   Form elements
   ──────────────────────────────────────────────────────────────────────────── */
.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.input:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-otp {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--blue);
  padding: 14px;
}

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

/* ──────────────────────────────────────────────────────────────────────────────
   Buttons
   ──────────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--blue);
  color: var(--white);
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
}
.btn-primary:hover { background: var(--blue-dark); box-shadow: 0 4px 12px rgba(26,86,219,0.30); }

.btn-secondary {
  background: var(--blue-light);
  color: var(--blue);
  border: 2px solid var(--blue-mid);
}
.btn-secondary:hover { background: #dbeafe; }

.btn-danger {
  background: #fee2e2;
  color: var(--red);
  border: none;
  padding: 6px 14px;
  font-size: 13px;
}
.btn-danger:hover { background: #fecaca; }

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-copy {
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid var(--blue-mid);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-copy:hover { background: #dbeafe; }
.btn-copy.copied { background: #d1fae5; color: var(--green); border-color: var(--green); }

/* ──────────────────────────────────────────────────────────────────────────────
   Flash messages
   ──────────────────────────────────────────────────────────────────────────── */
.flash {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.flash-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.flash-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.flash-url {
  font-family: monospace;
  font-size: 13px;
  word-break: break-all;
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.6);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ──────────────────────────────────────────────────────────────────────────────
   Upload zone
   ──────────────────────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--blue-mid);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  background: var(--blue-light);
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
  background: #dbeafe;
  border-color: var(--blue);
}

.upload-zone-icon {
  font-size: 40px;
  margin-bottom: 12px;
  display: block;
}

.upload-zone-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 4px;
}

.upload-zone-hint {
  font-size: 13px;
  color: var(--gray-600);
}

.upload-zone-filename {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 6px 12px;
  display: inline-block;
}

/* ──────────────────────────────────────────────────────────────────────────────
   Table
   ──────────────────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  color: var(--gray-800);
}

.table tr:last-child td { border-bottom: none; }

.table tr.highlighted td { background: var(--blue-light); }

.table tr:hover td { background: var(--gray-50); }

/* ──────────────────────────────────────────────────────────────────────────────
   Short URL pill
   ──────────────────────────────────────────────────────────────────────────── */
.short-url-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: monospace;
  text-decoration: none;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.short-url-pill:hover { background: #dbeafe; }

/* ──────────────────────────────────────────────────────────────────────────────
   Badge
   ──────────────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 10px;
  min-width: 24px;
}

/* ──────────────────────────────────────────────────────────────────────────────
   Dropdown select
   ──────────────────────────────────────────────────────────────────────────── */
.dropdown-select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a56db' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.dropdown-select:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }

/* ──────────────────────────────────────────────────────────────────────────────
   Empty state
   ──────────────────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 32px;
  border: 2px solid var(--blue-mid);
  border-radius: var(--radius);
  background: var(--blue-light);
}

.empty-state-icon { font-size: 48px; margin-bottom: 12px; display: block; }

.empty-state h3 {
  font-size: 18px;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.empty-state p { font-size: 14px; color: var(--gray-600); }

/* ──────────────────────────────────────────────────────────────────────────────
   Auth pages
   ──────────────────────────────────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--gray-600);
}

.auth-footer a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

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

.otp-info {
  font-size: 13px;
  color: var(--gray-600);
  text-align: center;
  margin-top: 12px;
}

/* ──────────────────────────────────────────────────────────────────────────────
   File info chip
   ──────────────────────────────────────────────────────────────────────────── */
.file-name {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 14px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* ──────────────────────────────────────────────────────────────────────────────
   Utility
   ──────────────────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 24px 0;
}

.text-muted { color: var(--gray-400); font-size: 13px; }

.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }

/* ──────────────────────────────────────────────────────────────────────────────
   Name input row (upload form)
   ──────────────────────────────────────────────────────────────────────────── */
.name-input-row {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  overflow: hidden;
  transition: border-color 0.15s;
}
.name-input-row:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.10);
}
.name-prefix, .name-suffix {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--gray-400);
  background: var(--gray-50);
  white-space: nowrap;
  user-select: none;
}
.name-prefix { border-right: 1px solid var(--gray-200); }
.name-suffix { border-left: 1px solid var(--gray-200); color: var(--gray-400); }
.name-input {
  flex: 1;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 10px 12px;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  min-width: 0;
}
.name-input:focus { outline: none; }
.input-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 6px;
}

/* ──────────────────────────────────────────────────────────────────────────────
   Responsive
   ──────────────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .container { padding: 20px 16px; }
  .container-narrow { padding: 32px 16px; }
  .card-body { padding: 24px 20px; }
  .card-section { padding: 20px; }
  .nav-email { display: none; }
  .table { font-size: 13px; }
  .table th, .table td { padding: 10px 12px; }
}
