:root {
  color-scheme: dark;
  --bg: #111827;
  --panel: #1f2937;
  --panel-deep: #111827;
  --panel-soft: #172033;
  --line: #374151;
  --line-soft: rgba(55, 65, 81, 0.72);
  --ink: #e5e7eb;
  --ink-strong: #f9fafb;
  --muted: #9ca3af;
  --blue: #066fd1;
  --blue-hover: #0a7fe8;
  --blue-soft: rgba(32, 107, 196, 0.14);
  --danger: #f87171;
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter Var", Inter, -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

button,
input,
select {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.brand-panel {
  min-height: 100vh;
  border-right: 1px solid rgba(32, 107, 196, 0.15);
  background: radial-gradient(ellipse at 50% 45%, rgba(32, 107, 196, 0.08) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.brand-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pulse-container {
  width: 160px;
  height: 160px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring {
  position: absolute;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(32, 107, 196, 0.25);
  border-radius: 50%;
  animation: pulse-expand 4s ease-out infinite;
}

.pulse-ring-2 {
  animation-delay: 1.3s;
}

.pulse-ring-3 {
  animation-delay: 2.6s;
}

@keyframes pulse-expand {
  0% {
    transform: scale(1);
    opacity: 0.5;
    border-color: rgba(32, 107, 196, 0.35);
  }

  100% {
    transform: scale(3.5);
    opacity: 0;
    border-color: rgba(32, 107, 196, 0);
  }
}

.brand-mark {
  position: relative;
  z-index: 2;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-hover);
  background: rgba(6, 111, 209, 0.08);
  border: 1px solid rgba(32, 107, 196, 0.16);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: 0;
  filter: drop-shadow(0 0 20px rgba(32, 107, 196, 0.3));
}

.brand-mark.small {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 0.9rem;
  filter: none;
}

.brand-title {
  margin: 22px 0 0;
  color: var(--ink-strong);
  font-size: clamp(3rem, 5vw, 4.35rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.brand-title span,
.auth-brand span {
  color: var(--blue-hover);
}

.brand-tagline {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.auth-column {
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-column > .auth-brand {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 28px);
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 0;
}

.auth-brand {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-strong);
}

.auth-brand strong {
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 0;
}

.auth-brand.inline {
  justify-content: flex-start;
  margin-bottom: 0;
}

.login-card {
  width: min(100%, 368px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 22px;
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin-bottom: 20px;
  color: var(--ink-strong);
  font-size: 1.25rem;
  font-weight: 650;
  text-align: center;
  letter-spacing: 0;
}

.muted {
  margin: -12px 0 0;
  color: var(--muted);
  text-align: center;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 500;
}

input,
select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-deep);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
  padding: 0 13px;
  outline: none;
}

input::placeholder {
  color: #8b93a3;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(6, 111, 209, 0.25);
}

.primary-button,
.secondary-button,
.download-button {
  min-height: 40px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  padding: 0 14px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.primary-button {
  width: 100%;
  margin-top: 18px;
  background: var(--blue);
  color: var(--ink-strong);
}

.primary-button:hover {
  background: var(--blue-hover);
}

.primary-button:disabled,
.secondary-button:disabled,
.download-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.primary-button:disabled:hover {
  background: var(--blue);
}

.secondary-button:disabled:hover {
  color: var(--muted);
  border-color: var(--line);
}

.secondary-button {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.secondary-button:hover {
  color: var(--ink-strong);
  border-color: var(--blue);
}

.button-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 10px;
  margin-top: 18px;
}

.button-row .primary-button {
  margin-top: 0;
}

.form-message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.dev-otp {
  margin: 14px 0 0;
  border: 1px solid rgba(6, 111, 209, 0.25);
  border-radius: 6px;
  background: var(--blue-soft);
  padding: 10px 12px;
  color: #93c5fd;
  font-size: 0.88rem;
  font-weight: 650;
  text-align: center;
}

.dashboard {
  width: min(1120px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 40px;
  display: grid;
  gap: 18px;
}

.dashboard-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: stretch;
  gap: 20px;
}

.dashboard-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-title h1 {
  flex: 1;
  min-width: 0;
  padding-right: 12px;
  margin-bottom: 0;
  color: var(--ink-strong);
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  font-weight: 650;
  letter-spacing: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.module-option {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  text-align: left;
  box-shadow: var(--shadow);
}

.module-option span {
  color: var(--ink-strong);
  font-size: 1rem;
  font-weight: 700;
}

.module-option strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.module-option.active {
  border-color: rgba(6, 111, 209, 0.62);
  background: linear-gradient(180deg, rgba(6, 111, 209, 0.18), rgba(31, 41, 55, 0.96));
}

.module-option.active strong {
  color: #93c5fd;
}

.module-option.disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
  filter: grayscale(0.35);
}

.module-panel {
  display: grid;
  gap: 18px;
}

.profile-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.profile-row {
  min-height: 78px;
  background: var(--panel);
  padding: 15px 18px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.profile-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-row strong {
  color: var(--ink-strong);
  font-size: 1.08rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.documents-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.section-heading {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin-bottom: 0;
  color: var(--ink-strong);
  font-size: 1.2rem;
  font-weight: 650;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.section-heading.compact {
  min-height: 58px;
}

.documents-list {
  display: grid;
}

.document-item {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.document-item:last-child {
  border-bottom: 0;
}

.document-item h3 {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.document-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.document-action {
  min-width: 104px;
  display: flex;
  justify-content: flex-end;
}

.download-button {
  background: var(--blue);
  color: var(--ink-strong);
}

.download-button:hover {
  background: var(--blue-hover);
}

.action-link {
  width: auto;
  min-width: 180px;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 0;
}

.action-buttons .primary-button,
.action-buttons .secondary-button {
  width: auto;
  min-width: 132px;
  margin-top: 0;
}

.missing-badge {
  min-height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--amber-soft);
  color: var(--amber);
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.dashboard-footer {
  display: flex;
  justify-content: flex-end;
  padding-bottom: env(safe-area-inset-bottom);
}

.admin-dashboard {
  gap: 16px;
}

.admin-dashboard .dashboard-title h1 {
  text-align: center;
}

.admin-dashboard .dashboard-title .secondary-button {
  width: auto;
  min-width: 96px;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat,
.analytics-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-stat {
  min-height: 104px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  padding: 16px;
}

.admin-stat span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-stat strong {
  color: var(--ink-strong);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 750;
  line-height: 1;
}

.admin-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.analytics-panel {
  overflow: hidden;
}

.analytics-list {
  display: grid;
}

.analytics-row,
.analytics-empty {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
}

.analytics-list .analytics-row:first-child,
.analytics-list .analytics-empty:first-child {
  border-top: 0;
}

.analytics-row strong {
  color: var(--ink-strong);
  font-size: 0.98rem;
  font-weight: 650;
}

.analytics-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.analytics-row > span {
  min-width: 64px;
  color: #93c5fd;
  font-weight: 750;
  text-align: right;
}

.analytics-empty {
  justify-content: center;
  color: var(--muted);
  font-weight: 650;
}

.compact-list .analytics-row {
  min-height: 52px;
}

.action-panel,
.submission-panel,
.confirmation-panel,
.saved-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.action-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.motorbike-layout {
  width: min(860px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 40px;
}

.intake-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-link {
  color: var(--ink-strong);
  text-decoration: none;
}

.intake-card {
  min-height: calc(100vh - 128px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.intake-card .login-card h1 {
  margin-bottom: 20px;
  color: var(--ink-strong);
  font-size: 1.25rem;
  font-weight: 650;
  text-align: center;
}

.intake-dashboard {
  width: 100%;
  min-height: 0;
  padding-top: 0;
}

.intake-dashboard .dashboard-title h1 {
  text-align: left;
}

.submission-panel {
  overflow: hidden;
}

.confirmation-panel,
.saved-panel {
  overflow: hidden;
}

.confirmation-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: rgba(7, 12, 24, 0.82);
  box-shadow: none;
  padding: calc(env(safe-area-inset-top) + 18px) 16px calc(env(safe-area-inset-bottom) + 18px);
}

.confirmation-card {
  width: min(100%, 520px);
  overflow: hidden;
  border: 1px solid rgba(147, 197, 253, 0.3);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

.confirmation-alert {
  border-bottom: 1px solid rgba(147, 197, 253, 0.24);
  background: linear-gradient(180deg, rgba(6, 111, 209, 0.26), rgba(23, 32, 51, 0.98));
  padding: 22px 20px 18px;
  text-align: center;
}

.confirmation-alert span {
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.confirmation-alert h2 {
  margin: 10px 0 10px;
  color: var(--ink-strong);
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: 0;
}

.confirmation-alert p {
  margin: 0 auto;
  max-width: 390px;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.5;
}

.confirmation-details {
  border-top: 0;
}

.confirmation-warning {
  margin: 16px 18px 18px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 6px;
  background: var(--amber-soft);
  color: #fde68a;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.45;
}

.submission-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 18px;
}

.submission-panel .primary-button {
  width: calc(100% - 36px);
  margin: 0 18px 18px;
}

.submission-panel .form-actions {
  margin: 0 18px 18px;
}

.submission-panel .form-actions .primary-button {
  width: 100%;
  margin: 0;
}

.form-note {
  margin: -4px 18px 16px;
  color: var(--muted);
  font-size: 0.84rem;
}

.confirmation-panel .form-note {
  margin-top: 0;
}

.confirmation-panel .button-row {
  margin: 0 18px 18px;
}

.confirmation-actions {
  grid-template-columns: 132px 1fr;
}

.confirmation-actions .primary-button,
.confirmation-actions .secondary-button {
  min-height: 48px;
  padding-top: 8px;
  padding-bottom: 8px;
  line-height: 1.25;
  text-align: center;
}

.exchange-form label {
  display: block;
  padding: 18px 18px 0;
}

.exchange-form .button-row {
  margin: 18px;
}

.exchange-request-actions {
  margin: 18px;
}

.exchange-request-actions .primary-button,
.exchange-request-actions .secondary-button {
  width: 100%;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.saved-panel {
  border-color: rgba(6, 111, 209, 0.42);
  background: var(--blue-soft);
}

.saved-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.saved-details .profile-row {
  border-top: 0;
}

.saved-panel .profile-row strong,
.confirmation-panel .profile-row strong {
  color: var(--ink-strong);
  font-weight: 650;
}

.saved-panel .saved-actions {
  margin: 18px;
}

.saved-panel .saved-actions .secondary-button {
  width: 100%;
}

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

  .brand-panel {
    display: none;
  }
}

@media (max-width: 860px) {
  .dashboard {
    width: min(100% - 24px, 640px);
    padding: 16px 0 28px;
  }

  .admin-summary-grid,
  .admin-columns {
    grid-template-columns: 1fr;
  }

  .profile-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 560px) {
  .auth-column {
    justify-content: center;
    padding: 24px 16px 42px;
  }

  .login-card {
    padding: 20px;
  }

  .section-heading,
  .document-item {
    align-items: stretch;
  }

  .section-heading {
    flex-direction: column;
  }

  .dashboard-header {
    min-height: 64px;
    align-items: center;
  }

  .dashboard-title {
    gap: 12px;
  }

  .dashboard-title h1 {
    font-size: 1.45rem;
    line-height: 1.15;
    padding-right: 18px;
  }

  .admin-dashboard .dashboard-title h1 {
    padding-right: 0;
  }

  .admin-stat {
    min-height: 84px;
  }

  .analytics-row {
    align-items: flex-start;
  }

  .dashboard-footer .secondary-button {
    width: 100%;
  }

  .action-panel,
  .saved-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .action-link {
    width: 100%;
  }

  .action-buttons {
    width: 100%;
    flex-direction: column;
  }

  .action-buttons .primary-button,
  .action-buttons .secondary-button {
    width: 100%;
  }

  .motorbike-layout {
    width: min(100% - 24px, 640px);
    padding: 16px 0 28px;
  }

  .intake-header {
    min-height: 58px;
  }

  .submission-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .saved-details {
    grid-template-columns: 1fr;
  }

  .intake-dashboard .dashboard-title {
    align-items: flex-start;
  }

  .intake-dashboard .dashboard-title .secondary-button {
    min-width: 92px;
  }

  .module-option {
    min-height: 78px;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .profile-row {
    min-height: 70px;
    padding: 14px 18px;
    gap: 9px;
  }

  .document-item {
    grid-template-columns: 1fr;
  }

  .document-action,
  .download-button {
    width: 100%;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .confirmation-modal {
    align-items: flex-start;
  }

  .confirmation-alert {
    padding: 20px 18px 16px;
  }

  .confirmation-alert h2 {
    font-size: 1.28rem;
  }
}
