:root {
  --bg-main: #020617;
  --bg-card: #020617;
  --accent: #3b8f6a;
  --accent-soft: #2f7255;
  --border-subtle: #1f2937;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #ef4444;
  --success: #22c55e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at top, #0b1120 0, #020617 60%, #000 100%);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  max-width: 1100px;
  margin: 40px auto;
  padding: 24px 28px;
  background: radial-gradient(circle at top left, #020617 0, #020617 40%, #000 100%);
  border-radius: 16px;
  /* fallback border for older browsers */
  border: 1px solid #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.9);
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.app-title {
  font-size: 22px;
  letter-spacing: 0.04em;
}

.app-title span {
  color: var(--accent);
}

.app-user {
  font-size: 14px;
  color: var(--text-muted);
}

.nav {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.nav a,
.nav button {
  font-size: 14px;
}

.page-title {
  font-size: 20px;
  margin-bottom: 18px;
}

.card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 12px;
  /* fallback border for older browsers */
  border: 1px solid #374151;
  border: 1px solid rgba(55, 65, 81, 0.9);
  padding: 24px 22px;
  margin-bottom: 20px;
}

.auth-card {
  width: min(520px, 82%);
  margin: 0 auto 18px;
}

.auth-title {
  text-align: center;
  margin-bottom: 14px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-title {
  font-size: 16px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Feature / landing styles (from index) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.feature-tile {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(55, 65, 81, 0.9);
  border-radius: 10px;
  padding: 14px 16px;
}

.muted-strong {
  color: var(--text-main);
  font-weight: 700;
}

.step-line {
  border-left: 3px solid rgba(44, 136, 94, 0.6);
  padding-left: 10px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.badge-soft {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(44, 136, 94, 0.14);
  border: 1px solid rgba(44, 136, 94, 0.35);
  color: var(--text-main);
  font-size: 12px;
  letter-spacing: 0.15px;
}

.section-block {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(55, 65, 81, 0.9);
  border-radius: 10px;
  padding: 16px 18px;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.pill-list li {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(44, 136, 94, 0.12);
  border: 1px solid rgba(44, 136, 94, 0.35);
  color: var(--text-main);
  font-size: 12px;
}

.form-grid {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.register-grid {
  max-width: 960px;
  width: 100%;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px 18px;
}

.register-grid .full-span {
  grid-column: 1 / -1;
}

/* Fallback spacing for environments that don't support gap on grid/flex */
.register-grid > * {
  margin-top: 14px;
}
.register-grid > * + * {
  margin-left: 18px;
}

.consent-block {
  background: rgba(15, 23, 42, 0.6);
  /* fallback border for older browsers */
  border: 1px solid #374151;
  border: 1px solid rgba(55, 65, 81, 0.6);
  border-radius: 10px;
  padding: 10px 12px;
}

.consent-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Fallback for flex gap (older browsers) */
.consent-options > * + * {
  margin-top: 10px;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.consent-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.consent-text {
  flex: 1;
  min-width: 200px;
  word-break: break-word;
}

.consent-text a {
  color: var(--accent);
  text-decoration: underline;
}

label {
  font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="file"],
select,
textarea {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(75, 85, 99, 0.9);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  font-size: 14px;
}

input[type="file"]::-webkit-file-upload-button {
  background: var(--accent);
  color: var(--text-main);
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 10px;
}

input[type="file"]::-webkit-file-upload-button:hover {
  background: #347f5e;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(59, 143, 106, 0.55);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--accent);
  color: #e5e7eb;
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: #347f5e;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 0 0;
}

.btn-outline {
  background: transparent;
  /* fallback border-color for older browsers */
  border-color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.7);
}

.btn-outline:hover {
  background: rgba(59, 143, 106, 0.2);
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: var(--success);
}

.btn-success:hover {
  background: #16a34a;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.badge-pending {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

.badge-approved {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

.badge-rejected {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th,
.table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.98);
}

.table tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.7);
}

.table tr:hover td {
  background: rgba(59, 143, 106, 0.18);
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
}

.flash-error {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
  /* fallback border for older browsers */
  border: 1px solid #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.5);
  margin-bottom: 12px;
  font-size: 14px;
}

.flash-success {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  /* fallback border for older browsers */
  border: 1px solid #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.5);
  margin-bottom: 12px;
  font-size: 14px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stack-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Fallback spacing for stack / stack-row when gap is not supported */
.stack > * + * { margin-top: 12px; }
.stack-row > * + * { margin-left: 8px; }

.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }

.text-right { text-align: right; }
.text-center { text-align: center; }

@media (max-width: 720px) {
  .app-shell {
    margin: 16px;
    padding: 18px 16px;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .nav {
    flex-wrap: wrap;
  }
}
