/* Billbrat App Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #0a0f1a;
  --surface: #0e1424;
  --card: #141b2d;
  --card-hover: #1a2238;
  --border: #1e2940;
  --muted: #5a6a8a;
  --text: #c4cee0;
  --bright: #e8edf5;
  --accent: #f5a623;
  --accent-hover: #e89a15;
  --accent-glow: rgba(245, 166, 35, 0.15);
  --red: #e74c3c;
  --green: #2ecc71;
  --red-dim: rgba(231, 76, 60, 0.12);
  --green-dim: rgba(46, 204, 113, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--ink);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--bright);
  line-height: 1.2;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

.app-nav {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-nav .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--bright);
  letter-spacing: -0.5px;
  text-decoration: none;
}
.app-nav .logo span { color: var(--accent); }

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

.nav-user {
  font-size: 0.85rem;
  color: var(--muted);
}

.app-main {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
  width: 100%;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--ink);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--ink); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--card);
  color: var(--bright);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--card-hover); color: var(--bright); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  font-size: 0.85rem;
}
.btn-ghost:hover { color: var(--bright); }

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-block { width: 100%; }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

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

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bright);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--bright);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
}
.form-input::placeholder { color: var(--muted); }

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.form-help {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-required {
  color: var(--red);
  font-weight: 600;
  font-size: 0.75rem;
}

/* Upload area */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.upload-zone-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.upload-zone h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.upload-zone p {
  font-size: 0.85rem;
  color: var(--muted);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* File list */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.file-name {
  font-size: 0.85rem;
  color: var(--bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 0.75rem;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.file-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  line-height: 1;
}
.file-remove:hover { color: var(--red); }

/* OTP */
.otp-input-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 24px 0;
}

.otp-digit {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--bright);
  transition: border-color 0.15s;
}
.otp-digit:focus {
  outline: none;
  border-color: var(--accent);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

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

/* Case list */
.case-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.case-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
}

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

.case-id {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--bright);
}

.case-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-pending {
  color: var(--accent);
  background: var(--accent-glow);
}

.status-processed {
  color: var(--green);
  background: var(--green-dim);
}

.case-meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 16px;
}

/* Gateway */
.gateway {
  text-align: center;
  padding-top: 80px;
}

.gateway h1 {
  font-size: 2rem;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.gateway h1 em {
  font-style: normal;
  color: var(--accent);
}

.gateway-sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 40px;
}

.gateway-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
  margin: 0 auto;
}

/* Trust badges */
.trust-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.trust-icon {
  font-size: 1rem;
}

/* Page header */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 1.6rem;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* Status message */
.status-msg {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.status-msg.error {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.status-msg.success {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-msg.info {
  background: rgba(52, 152, 219, 0.1);
  color: #5dade2;
  border: 1px solid rgba(52, 152, 219, 0.3);
}

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

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

/* Empty state */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 24px;
  text-decoration: none;
}
.back-link:hover { color: var(--bright); }

/* OTP section */
.otp-section {
  text-align: center;
}

.otp-section h1 {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.otp-section .subtitle {
  color: var(--muted);
  margin-bottom: 32px;
}

.contact-type-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.contact-type-btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--card);
  color: var(--muted);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.contact-type-btn.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.resend-link {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 16px;
}

.resend-link button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
}
.resend-link button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: none;
}

/* Upload Confirmation Screen */
.upload-confirm-page {
  max-width: 480px;
  margin: 0 auto;
}

.upload-confirm-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--green-dim);
  border: 1px solid rgba(46, 204, 113, 0.25);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 36px;
}

.upload-confirm-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.upload-confirm-title {
  font-size: 1.05rem;
  color: var(--green);
  margin-bottom: 4px;
}

.upload-confirm-sub {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}

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

/* Responsive */
@media (max-width: 640px) {
  .app-main { padding: 32px 16px; }
  .gateway { padding-top: 48px; }
  .gateway h1 { font-size: 1.6rem; }
  .otp-digit { width: 44px; height: 52px; font-size: 1.3rem; }
  .trust-row { gap: 16px; }
}
