/* Masdar Carrier — design system */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=Figtree:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --mc-ink: #0c1f1e;
  --mc-teal: #0d5c56;
  --mc-teal-deep: #083f3b;
  --mc-mist: #e8f1ef;
  --mc-paper: #f7faf9;
  --mc-signal: #e85d04;
  --mc-signal-deep: #c44a00;
  --mc-line: rgba(12, 31, 30, 0.1);
  --mc-muted: #5c726f;
  --mc-white: #ffffff;
  --mc-ok: #1a7a4c;
  --mc-warn: #b45309;
  --mc-danger: #b42318;
  --mc-radius: 18px;
  --mc-shadow: 0 18px 50px rgba(8, 63, 59, 0.08);
  --mc-font: "Figtree", sans-serif;
  --mc-display: "Syne", sans-serif;
  --mc-mono: "IBM Plex Mono", monospace;
  --mc-nav-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.mc-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--mc-font);
  color: var(--mc-ink);
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(232, 93, 4, 0.08), transparent 55%),
    radial-gradient(700px 380px at -10% 20%, rgba(13, 92, 86, 0.1), transparent 50%),
    linear-gradient(180deg, #f3f8f7 0%, var(--mc-paper) 40%, #eef5f3 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body.mc-body a { color: var(--mc-teal); }
body.mc-body a:hover { color: var(--mc-signal); }

/* Route grid atmosphere */
.mc-grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(var(--mc-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--mc-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

.mc-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.mc-sidebar {
  width: var(--mc-nav-w);
  flex-shrink: 0;
  background: linear-gradient(175deg, var(--mc-teal-deep) 0%, #0a3330 55%, #071f1d 100%);
  color: #e8f4f2;
  padding: 1.25rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 8px 0 40px rgba(8, 63, 59, 0.18);
}

.mc-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none !important;
  color: #fff !important;
  padding: 0.35rem 0.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 1rem;
  animation: mc-fade-up 0.6s ease both;
}

.mc-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--mc-signal), #ff9f1c);
  display: grid;
  place-items: center;
  font-family: var(--mc-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  box-shadow: 0 8px 20px rgba(232, 93, 4, 0.35);
  position: relative;
  overflow: hidden;
}

.mc-brand-mark::after {
  content: "";
  position: absolute;
  inset: -40% auto auto -40%;
  width: 80%;
  height: 80%;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  animation: mc-shimmer 3.5s ease-in-out infinite;
}

.mc-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.mc-brand-text strong {
  font-family: var(--mc-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mc-brand-text span {
  font-size: 0.72rem;
  opacity: 0.7;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mc-nav-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.5;
  padding: 0.75rem 0.75rem 0.35rem;
}

.mc-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: rgba(232, 244, 242, 0.82) !important;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 0.92rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  margin-bottom: 2px;
}

.mc-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff !important;
  transform: translateX(2px);
}

.mc-nav a.active {
  background: rgba(232, 93, 4, 0.22);
  color: #fff !important;
  box-shadow: inset 3px 0 0 var(--mc-signal);
}

.mc-nav-ico {
  width: 1.25rem;
  text-align: center;
  opacity: 0.85;
  font-size: 0.85rem;
}

.mc-sidebar-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.mc-user-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.35rem;
  font-size: 0.85rem;
}

.mc-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1.75rem 3rem;
  animation: mc-fade-up 0.55s ease both;
}

.mc-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.mc-burger {
  border: 0;
  background: var(--mc-teal);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 1.1rem;
}

/* Surfaces — interactive panels only */
.carrier-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(13, 92, 86, 0.1);
  border-radius: var(--mc-radius);
  padding: 1.35rem;
  box-shadow: var(--mc-shadow);
}

.mc-panel {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(13, 92, 86, 0.1);
  border-radius: var(--mc-radius);
  padding: 1.35rem;
  box-shadow: var(--mc-shadow);
}

.mc-hero-ops {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  min-height: 220px;
  padding: 2rem 2.25rem;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(8, 63, 59, 0.92) 0%, rgba(13, 92, 86, 0.75) 45%, rgba(232, 93, 4, 0.55) 100%),
    url('/public/assets/img/carrier/hero.jpg') center/cover no-repeat;
  margin-bottom: 1.5rem;
  box-shadow: 0 24px 60px rgba(8, 63, 59, 0.25);
}

.mc-hero-ops::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 30h60M30 0v60' stroke='rgba(255,255,255,0.08)' stroke-width='1' fill='none'/%3E%3C/svg%3E");
  opacity: 0.7;
  pointer-events: none;
}

.mc-hero-ops > * { position: relative; z-index: 1; }

.mc-hero-ops .mc-brand-kicker {
  font-family: var(--mc-display);
  font-size: clamp(1.85rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 0.5rem;
}

.mc-hero-ops p {
  max-width: 36rem;
  margin: 0 0 1.25rem;
  opacity: 0.9;
  font-size: 1.05rem;
}

.mc-cta-row { display: flex; flex-wrap: wrap; gap: 0.65rem; }

.stat {
  font-family: var(--mc-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--mc-teal-deep);
  line-height: 1.1;
}

.muted, .mc-muted { color: var(--mc-muted) !important; }

.mc-page-title {
  font-family: var(--mc-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
  font-size: 1.65rem;
}

.mc-page-sub { color: var(--mc-muted); margin: 0 0 1.25rem; }

/* Buttons */
.btn-carrier,
.mc-btn {
  background: linear-gradient(135deg, var(--mc-signal), var(--mc-signal-deep));
  color: #fff !important;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1.25rem;
  font-weight: 600;
  font-family: var(--mc-font);
  box-shadow: 0 10px 24px rgba(232, 93, 4, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-carrier:hover,
.mc-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  color: #fff !important;
  box-shadow: 0 14px 28px rgba(232, 93, 4, 0.35);
}

.btn-outline-light,
.mc-btn-ghost {
  background: transparent !important;
  border: 1.5px solid rgba(13, 92, 86, 0.25) !important;
  color: var(--mc-teal-deep) !important;
  border-radius: 999px;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
}

.btn-outline-light:hover,
.mc-btn-ghost:hover {
  border-color: var(--mc-teal) !important;
  background: rgba(13, 92, 86, 0.06) !important;
  color: var(--mc-teal-deep) !important;
}

.mc-hero-ops .mc-btn-ghost {
  border-color: rgba(255,255,255,0.45) !important;
  color: #fff !important;
}

.mc-hero-ops .mc-btn-ghost:hover {
  background: rgba(255,255,255,0.12) !important;
  color: #fff !important;
}

/* Forms */
.form-control,
.custom-select,
select.form-control,
textarea.form-control {
  background: #fff !important;
  border: 1.5px solid rgba(13, 92, 86, 0.16) !important;
  color: var(--mc-ink) !important;
  border-radius: 12px !important;
  min-height: 44px;
  box-shadow: none !important;
}

.form-control:focus {
  border-color: var(--mc-teal) !important;
  box-shadow: 0 0 0 3px rgba(13, 92, 86, 0.15) !important;
}

label { font-weight: 600; font-size: 0.86rem; color: var(--mc-teal-deep); }

/* Tables */
.table {
  color: var(--mc-ink) !important;
  margin-bottom: 0;
}

.table thead th {
  border-top: 0;
  border-bottom: 1px solid var(--mc-line);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mc-muted);
  font-weight: 600;
  background: transparent;
}

.table td {
  border-top: 1px solid rgba(13, 92, 86, 0.06);
  vertical-align: middle;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.table tbody tr {
  transition: background 0.15s ease;
}

.table tbody tr:hover {
  background: rgba(13, 92, 86, 0.04);
}

.mc-mono {
  font-family: var(--mc-mono);
  font-size: 0.86rem;
  letter-spacing: -0.02em;
}

.mc-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--mc-mist);
  color: var(--mc-teal-deep);
}

.mc-badge.is-pending { background: #fff4e5; color: #9a3412; }
.mc-badge.is-on_the_way, .mc-badge.is-picked_up { background: #e0f2fe; color: #075985; }
.mc-badge.is-delivered { background: #dcfce7; color: #166534; }
.mc-badge.is-failed, .mc-badge.is-cancelled { background: #fee2e2; color: #991b1b; }

.mc-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.mc-stat-tile {
  padding: 1.1rem 1.2rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(13, 92, 86, 0.08);
  position: relative;
  overflow: hidden;
  animation: mc-fade-up 0.6s ease both;
}

.mc-stat-tile:nth-child(2) { animation-delay: 0.06s; }
.mc-stat-tile:nth-child(3) { animation-delay: 0.12s; }
.mc-stat-tile:nth-child(4) { animation-delay: 0.18s; }

.mc-stat-tile::after {
  content: "";
  position: absolute;
  right: -12px;
  bottom: -12px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(13, 92, 86, 0.06);
}

.mc-stat-tile .muted { font-size: 0.8rem; margin-bottom: 0.35rem; }

.mc-alert {
  border-radius: 12px;
  border: 0;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #ffedd5; color: #9a3412; }
.alert-info { background: #e0f2fe; color: #075985; }

/* Guest / login */
.mc-guest {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  position: relative;
  z-index: 1;
}

.mc-guest-visual {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(125deg, rgba(8, 63, 59, 0.88) 0%, rgba(13, 92, 86, 0.55) 50%, rgba(232, 93, 4, 0.4) 100%),
    url('/public/assets/img/carrier/hero.jpg') center/cover no-repeat;
  color: #fff;
  padding: clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.mc-guest-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 31, 29, 0.75), transparent 55%);
  pointer-events: none;
}

.mc-guest-visual > * { position: relative; z-index: 1; }

.mc-guest-brand {
  font-family: var(--mc-display);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin: 0 0 0.75rem;
  animation: mc-fade-up 0.7s ease both;
}

.mc-guest-tag {
  font-size: 1.15rem;
  max-width: 28rem;
  opacity: 0.92;
  margin: 0;
  animation: mc-fade-up 0.7s 0.1s ease both;
}

.mc-route-line {
  position: absolute;
  top: 18%;
  left: 8%;
  width: 70%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  transform-origin: left center;
  animation: mc-draw 2.2s ease-out both;
  z-index: 1;
}

.mc-guest-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--mc-paper);
}

.mc-login-panel {
  width: 100%;
  max-width: 400px;
  animation: mc-fade-up 0.65s 0.15s ease both;
}

.mc-login-panel h1 {
  font-family: var(--mc-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--mc-teal-deep);
}

.mc-login-panel .btn-carrier {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.mc-more-menu {
  position: relative;
}

.mc-more-menu summary {
  list-style: none;
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: rgba(232, 244, 242, 0.82);
  font-weight: 500;
  font-size: 0.92rem;
}

.mc-more-menu summary::-webkit-details-marker { display: none; }

.mc-more-menu[open] summary {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.mc-more-panel {
  margin-top: 0.35rem;
  padding: 0.35rem;
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  max-height: 280px;
  overflow-y: auto;
}

.mc-more-panel a {
  display: block;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  color: rgba(232, 244, 242, 0.85) !important;
  text-decoration: none !important;
  font-size: 0.86rem;
}

.mc-more-panel a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff !important;
}

@keyframes mc-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes mc-draw {
  from { transform: scaleX(0); opacity: 0; }
  to { transform: scaleX(1); opacity: 1; }
}

@keyframes mc-shimmer {
  0%, 100% { transform: translate(0, 0); opacity: 0.35; }
  50% { transform: translate(30%, 40%); opacity: 0.55; }
}

@media (max-width: 991px) {
  .mc-guest { grid-template-columns: 1fr; }
  .mc-guest-visual {
    min-height: 42vh;
    justify-content: flex-end;
  }
  .mc-guest-brand { font-size: 2.4rem; }
  .mc-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
  }
  .mc-shell.is-nav-open .mc-sidebar { transform: translateX(0); }
  .mc-topbar { display: flex; }
  .mc-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .mc-main { padding: 1rem 1rem 2.5rem; }
  .mc-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 31, 29, 0.45);
    z-index: 40;
  }
  .mc-shell.is-nav-open .mc-backdrop { display: block; }
}

[dir="rtl"] .mc-shell { flex-direction: row-reverse; }
[dir="rtl"] .mc-sidebar { box-shadow: -8px 0 40px rgba(8, 63, 59, 0.18); }
[dir="rtl"] .mc-nav a.active { box-shadow: inset -3px 0 0 var(--mc-signal); }

@media (max-width: 575px) {
  .mc-stat-grid { grid-template-columns: 1fr 1fr; gap: 0.65rem; }
  .mc-hero-ops { padding: 1.5rem; min-height: 200px; }
}
