/*
 * Transmotion Client Portal — brand stylesheet.
 * Tokens mirror the marketing site (index.html / dashboard.html / portal.html):
 * navy #1A3A5C, blue #2B7EC1, blue-light #3D92D4, off-white #F5F7FA, charcoal #333.
 * Fonts: Barlow (headings, 700-900) + Inter (body) via Google Fonts, loaded in the header partial.
 */

:root {
  --navy: #1a3a5c;
  --blue: #2b7ec1;
  --blue-light: #3d92d4;
  --blue-dark: #12294a;
  --off-white: #f5f7fa;
  --charcoal: #333;
  --white: #fff;
  --g100: #eef2f7;
  --g200: #d8e0eb;
  --g400: #8898af;
  --g600: #4d5f78;
  --g800: #1c2b3d;
  --border: var(--g200);
  --ok: #15803d;
  --ok-bg: rgba(34, 197, 94, 0.14);
  --warn: #b45309;
  --warn-bg: rgba(245, 158, 11, 0.14);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);
  --info: #1d6fb0;
  --info-bg: rgba(43, 126, 193, 0.12);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--charcoal);
  background: var(--off-white);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: "Barlow", sans-serif;
  color: var(--navy);
  margin: 0 0 8px;
}

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

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 2rem 64px;
  width: 100%;
  flex: 1;
}

@media (max-width: 640px) {
  .page {
    padding: 24px 1.1rem 48px;
  }
}

/* ---------------------------------------------------------------- */
/* Header                                                            */
/* ---------------------------------------------------------------- */

.site-header {
  background: rgba(26, 58, 92, 0.97);
  box-shadow: 0 1px 0 rgba(43, 126, 193, 0.2);
}

.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 2rem;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .site-header__inner {
    padding: 10px 1.1rem;
    gap: 10px;
  }
  .site-header__logo {
    height: 36px;
  }
  .site-nav {
    gap: 0.9rem;
  }
  .btn--nav {
    padding: 7px 14px;
    font-size: 12.5px;
  }
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
}
.site-header__brand:hover {
  opacity: 0.9;
}
.site-header__logo {
  height: 46px;
  object-fit: contain;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-nav__link {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.15s;
}
.site-nav__link:hover {
  color: #fff;
}
.site-nav__link[aria-current="page"] {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-nav__logout {
  margin: 0;
}

.btn--nav {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn--nav:hover {
  background: var(--blue-light);
  color: #fff;
}

/* ---------------------------------------------------------------- */
/* Footer                                                             */
/* ---------------------------------------------------------------- */

.site-footer {
  background: var(--blue-dark);
  margin-top: 48px;
}

.site-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

@media (max-width: 640px) {
  .site-footer__inner {
    padding: 24px 1.1rem;
    flex-direction: column;
    align-items: flex-start;
  }
}

.site-footer__inner p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}
.site-footer__inner a {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
}
.site-footer__inner a:hover {
  color: #fff;
}
.site-footer__links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}
.site-footer__legal {
  color: rgba(255, 255, 255, 0.32) !important;
  font-size: 12px !important;
}

/* ---------------------------------------------------------------- */
/* Cards & auth                                                       */
/* ---------------------------------------------------------------- */

.auth-card {
  max-width: 430px;
  margin: 40px auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 40px;
  box-shadow: 0 18px 50px rgba(26, 58, 92, 0.08);
}

@media (max-width: 480px) {
  .auth-card {
    margin: 16px auto;
    padding: 28px 22px;
  }
}

.auth-card h1 {
  font-weight: 900;
  font-size: 24px;
  text-align: center;
  margin-bottom: 6px;
}

.auth-card__intro {
  font-size: 14px;
  color: var(--g600);
  text-align: center;
  margin-bottom: 26px;
  line-height: 1.5;
}

.auth-card__help {
  text-align: center;
  font-size: 13px;
  color: var(--g600);
  margin-top: 24px;
}
.auth-card__help a {
  color: var(--blue);
  font-weight: 600;
}

.auth-card--error h1 {
  color: var(--navy);
}
.auth-card--error p:not(.auth-card__intro) {
  text-align: center;
  color: var(--g600);
  margin-bottom: 22px;
}
.auth-card--error p:last-child {
  margin-bottom: 0;
  text-align: center;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 26px;
  margin-bottom: 20px;
}
.card h2 {
  font-weight: 800;
  font-size: 18px;
}
.card--highlight {
  border-color: var(--blue-light);
  box-shadow: 0 10px 30px rgba(26, 58, 92, 0.08);
}

/* ---------------------------------------------------------------- */
/* Forms                                                              */
/* ---------------------------------------------------------------- */

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form--inline {
  flex-flow: row wrap;
  align-items: flex-end;
}
@media (max-width: 640px) {
  .form--inline {
    flex-direction: column;
    align-items: stretch;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field__label {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--g600);
}
.field__hint {
  color: var(--g600);
  font-size: 12px;
}

.field input,
.field select,
.field textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--g200);
  border-radius: 9px;
  font-family: "Inter", sans-serif;
  font-size: 14.5px;
  color: var(--navy);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(43, 126, 193, 0.12);
}

.copy-field {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--g200);
  border-radius: 9px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  color: var(--navy);
  background: var(--off-white);
}

/* ---------------------------------------------------------------- */
/* Buttons                                                            */
/* ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 22px;
  border-radius: 9px;
  border: 1.5px solid transparent;
  font-family: "Inter", sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.2;
}
.btn--primary {
  background: var(--navy);
  color: #fff;
  width: 100%;
}
.btn--primary:hover {
  background: var(--blue);
  color: #fff;
}
.btn--secondary {
  background: var(--white);
  border-color: var(--g200);
  color: var(--navy);
}
.btn--secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.btn--danger {
  background: var(--white);
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--danger);
}
.btn--danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn--link {
  background: none;
  border: none;
  padding: 0;
  color: var(--blue);
  font-weight: 600;
}
.btn--link:hover {
  color: var(--blue-light);
  text-decoration: underline;
}
.btn--sm {
  padding: 8px 13px;
  font-size: 12.5px;
}

/* ---------------------------------------------------------------- */
/* Alerts                                                             */
/* ---------------------------------------------------------------- */

.alert {
  padding: 13px 16px;
  border-radius: 10px;
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.alert--error {
  background: var(--danger-bg);
  border: 1px solid rgba(220, 38, 38, 0.28);
  color: var(--danger);
}
.alert--info {
  background: var(--info-bg);
  border: 1px solid rgba(43, 126, 193, 0.25);
  color: var(--navy);
}

/* ---------------------------------------------------------------- */
/* Dashboard                                                          */
/* ---------------------------------------------------------------- */

.dashboard__welcome h1 {
  font-weight: 900;
  font-size: 30px;
}
.dashboard__welcome p {
  font-size: 14px;
  color: var(--g600);
  margin-top: 4px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 28px 0 32px;
}
@media (max-width: 760px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 420px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.stat-card__value {
  display: block;
  font-family: "Barlow", sans-serif;
  font-weight: 900;
  font-size: 28px;
  color: var(--navy);
  line-height: 1;
}
.stat-card__label {
  display: block;
  font-size: 12px;
  color: var(--g600);
  margin-top: 7px;
  font-weight: 600;
}

.dashboard__layout {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 26px;
  align-items: start;
}
@media (max-width: 880px) {
  .dashboard__layout {
    grid-template-columns: 1fr;
  }
}

.dashboard__main h2 {
  font-weight: 800;
  font-size: 18px;
  margin: 30px 0 14px;
}
.dashboard__main h2:first-child {
  margin-top: 0;
}

/* ---------------------------------------------------------------- */
/* Order cards                                                        */
/* ---------------------------------------------------------------- */

.order-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.order-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}
.order-card__title {
  font-family: "Barlow", sans-serif;
  font-weight: 800;
  font-size: 17px;
  color: var(--navy);
  margin: 0;
}
.order-card__meta {
  font-size: 13.5px;
  color: var(--g600);
  line-height: 1.7;
  margin: 4px 0;
}
.order-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.order-card__actions .btn {
  width: auto;
}

/* Order detail page */
.order-detail__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
}
.order-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.order-detail__actions .btn {
  width: auto;
}

/* ---------------------------------------------------------------- */
/* Progress steps                                                     */
/* ---------------------------------------------------------------- */

.progress {
  list-style: none;
  display: flex;
  padding: 0;
  margin: 18px 0 8px;
}
.progress__step {
  flex: 1;
  position: relative;
  text-align: center;
}
.progress__step:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 6px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--g200);
  z-index: 0;
}
.progress__step.is-done:not(:first-child)::before {
  background: var(--blue);
}
.progress__dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--g200);
  border: 2px solid var(--white);
  margin: 0 auto 8px;
}
.progress__step.is-done .progress__dot {
  background: var(--blue);
}
.progress__text {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--g600);
}
.progress__step.is-done .progress__text {
  color: var(--blue);
}
.progress--lg .progress__dot {
  width: 18px;
  height: 18px;
}
.progress--lg .progress__text {
  font-size: 11.5px;
  margin-top: 2px;
}

/* ---------------------------------------------------------------- */
/* Pills / status badges                                              */
/* ---------------------------------------------------------------- */

.pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--info-bg);
  color: var(--info);
}
.pill--status {
  background: var(--info-bg);
  color: var(--info);
}
.pill--paid,
.pill--active {
  background: var(--ok-bg);
  color: var(--ok);
}
.pill--pending,
.pill--invited {
  background: var(--warn-bg);
  color: var(--warn);
}
.pill--disabled {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ---------------------------------------------------------------- */
/* Lists                                                              */
/* ---------------------------------------------------------------- */

.detail-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 13.5px;
}
.detail-list dt {
  color: var(--g600);
}
.detail-list dd {
  margin: 0;
  color: var(--navy);
  font-weight: 600;
  text-align: right;
}

.completed-list,
.invoice-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.completed-list__item,
.invoice-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--g100);
  font-size: 13.5px;
}
.completed-list__item:last-child,
.invoice-list__item:last-child {
  border-bottom: none;
}
.completed-list__title {
  margin: 0;
  font-weight: 700;
  color: var(--navy);
  font-size: 14.5px;
}

.sidebar-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 18px;
}
.sidebar-box h2 {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 14px;
}
.sidebar-box--help p {
  font-size: 13.5px;
  color: var(--g600);
  margin: 0 0 6px;
}
.sidebar-box--help a {
  font-weight: 700;
}

.muted {
  color: var(--g600);
}

/* ---------------------------------------------------------------- */
/* Admin                                                              */
/* ---------------------------------------------------------------- */

.admin h1 {
  font-weight: 900;
  font-size: 28px;
  margin-bottom: 20px;
}

.table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--g100);
  white-space: nowrap;
}
.data-table th {
  font-family: "Barlow", sans-serif;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--g600);
}
.data-table tbody tr:hover {
  background: var(--off-white);
}
.data-table__actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}
.data-table__actions form {
  margin: 0;
}

/* Work-order photo grid (order detail page). */
.photo-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.photo-grid__item {
  margin: 0;
}
.photo-grid__link {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--g200);
  background: var(--off-white);
  aspect-ratio: 4 / 3;
}
.photo-grid__link:hover {
  border-color: var(--blue);
}
.photo-grid__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-grid__label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: "Barlow", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(26, 58, 92, 0.85);
}
