/* =========================================================
   TavaEats Delivery Team
   Visual Shell V1
   ========================================================= */

:root {
  --page: #f5f7f6;
  --surface: #ffffff;

  --text: #17211d;
  --text-soft: #66716c;
  --text-faint: #8b9691;

  --brand: #176b4d;
  --brand-deep: #10523b;
  --brand-soft: #eaf4ef;

  --border: #dfe6e2;
  --focus: rgba(23, 107, 77, 0.18);

  --shadow:
    0 24px 70px rgba(24, 40, 33, 0.09);

  --radius-large: 28px;
  --radius-medium: 16px;

  --content-width: 460px;
}


/* =========================================================
   Foundation
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;

  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(23, 107, 77, 0.07),
      transparent 34rem
    ),
    var(--page);

  color: var(--text);

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}


/* =========================================================
   Universal application shell
   ========================================================= */

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

  display: grid;
  place-items: center;

  padding:
    max(24px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}


/* =========================================================
   Welcome surface
   ========================================================= */

.welcome {
  width: min(100%, var(--content-width));

  background: var(--surface);

  border: 1px solid rgba(23, 33, 29, 0.06);
  border-radius: var(--radius-large);

  box-shadow: var(--shadow);

  padding: 34px;
}


/* =========================================================
   Brand
   ========================================================= */

.brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;

  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.brand-identity {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: auto;
  height: 76px;
  max-width: 76px;
  object-fit: contain;
}

.brand-team {
  color: var(--text-soft);

  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}


/* =========================================================
   Welcome message
   ========================================================= */

.welcome-copy {
  padding: 38px 0 30px;
}

.eyebrow {
  margin: 0 0 10px;

  color: var(--brand);

  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1 {
  margin: 0;

  color: var(--text);

  font-size: clamp(34px, 4vw, 40px);
  line-height: 1.08;
  font-weight: 760;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.welcome-message {
  margin: 20px 0 0;

  max-width: 360px;

  color: var(--text-soft);

  font-size: 17px;
  line-height: 1.55;
}


/* =========================================================
   Sign in
   ========================================================= */

.login-form {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 9px;
}

.field label {
  color: var(--text);

  font-size: 14px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 58px;

  appearance: none;

  padding: 0 17px;

  background: #ffffff;
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: var(--radius-medium);

  outline: none;

  font-size: 17px;

  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.field input::placeholder {
  color: var(--text-faint);
}

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--focus);
}

.primary-action {
  width: 100%;
  min-height: 60px;

  appearance: none;

  border: 0;
  border-radius: var(--radius-medium);

  background: var(--brand);
  color: #ffffff;

  cursor: pointer;

  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;

  transition:
    background 150ms ease,
    transform 100ms ease,
    box-shadow 150ms ease;
}

.primary-action:hover {
  background: var(--brand-deep);
}

.primary-action:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px var(--focus);
}

.primary-action:active {
  transform: translateY(1px);
}


/* =========================================================
   Delivery Driver Registration V1
   ========================================================= */

.registration-entry {
  width: fit-content;
  min-height: 44px;

  margin: -2px auto 0;
  padding: 8px 12px;

  appearance: none;

  border: 0;
  background: transparent;
  color: var(--text);

  cursor: pointer;

  font: inherit;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;

  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.registration-entry:hover {
  color: var(--brand-deep);
}

.registration-entry:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

.registration-entry:disabled {
  opacity: 0.6;
  cursor: default;
}


/* =========================================================
   Footer
   ========================================================= */

.welcome-footer {
  padding-top: 28px;

  text-align: center;
}

.welcome-footer p {
  margin: 0;

  color: var(--text-faint);

  font-size: 13px;
  font-weight: 600;
}


/* =========================================================
   Small phones
   ========================================================= */

@media (max-width: 520px) {
  body {
    background: var(--surface);
  }

  .app-shell {
    display: grid;
    place-items: center;

    padding:
      max(26px, env(safe-area-inset-top))
      max(22px, env(safe-area-inset-right))
      max(26px, env(safe-area-inset-bottom))
      max(22px, env(safe-area-inset-left));
  }

  .welcome {
    width: 100%;
    max-width: 390px;

    border: 0;
    border-radius: 0;

    box-shadow: none;

    padding: 0;
  }

  .brand {
    padding-bottom: 22px;
  }

  .welcome-copy {
    padding: 34px 0 30px;
  }

  h1 {
    font-size: clamp(27px, 7vw, 32px);
    line-height: 1.08;
    letter-spacing: -0.035em;
    white-space: normal;
  }

  .welcome-message {
    font-size: 17px;
  }

  .field input,
  .primary-action {
    min-height: 62px;
  }

  .welcome-footer {
    padding-top: 28px;
  }
}


/* =========================================================
   Very narrow devices
   ========================================================= */

@media (max-width: 350px) {
  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  h1 {
    font-size: 28px;
    letter-spacing: -0.035em;
  }
}


/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

[hidden] {
  display: none !important;
}


/* TAVAEATS DELIVERY WORKSPACE V1 */
/* =========================================================
   Delivery workspace
   ========================================================= */

.delivery-workspace {
  display: grid;
  gap: 18px;
}

.delivery-status {
  display: grid;
  gap: 8px;

  padding: 20px;

  background: var(--brand-soft);
  border-radius: var(--radius-medium);
}

.delivery-status-title {
  margin: 0;

  color: var(--brand);

  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.delivery-status-message {
  margin: 0;

  color: var(--text);

  font-size: 17px;
  line-height: 1.5;
  font-weight: 650;
}

.delivery-offer {
  display: grid;
  gap: 22px;
}

.delivery-offer-heading {
  display: grid;
  gap: 6px;
}

.delivery-offer-label {
  margin: 0;

  color: var(--brand);

  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.delivery-merchant {
  margin: 0;

  color: var(--text);

  font-size: 28px;
  line-height: 1.1;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.delivery-order-reference {
  margin: 0;

  color: var(--text-soft);

  font-size: 14px;
  line-height: 1.45;
}

.delivery-detail {
  display: grid;
  gap: 6px;

  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.delivery-detail-label {
  margin: 0;

  color: var(--text-faint);

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.delivery-detail-value {
  margin: 0;

  color: var(--text);

  font-size: 17px;
  line-height: 1.45;
  font-weight: 650;
}

.delivery-detail-note {
  margin: 0;

  color: var(--text-soft);

  font-size: 14px;
  line-height: 1.5;
}

.delivery-route {
  display: flex;
  align-items: center;
  gap: 9px;

  color: var(--text-soft);

  font-size: 15px;
  font-weight: 700;
}

.delivery-route-separator {
  color: var(--text-faint);
}

.delivery-earning {
  display: grid;
  gap: 5px;

  padding: 20px;

  background: var(--brand-soft);
  border-radius: var(--radius-medium);
}

.delivery-earning-label {
  margin: 0;

  color: var(--brand);

  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.delivery-earning-amount {
  margin: 0;

  color: var(--brand-deep);

  font-size: 30px;
  line-height: 1;
  font-weight: 820;
  letter-spacing: -0.035em;
}

.delivery-offer .primary-action[disabled] {
  cursor: default;
  opacity: 1;
}

.delivery-offer .primary-action[disabled]:hover {
  background: var(--brand);
}

@media (max-width: 520px) {
  .delivery-merchant {
    font-size: 27px;
  }

  .delivery-detail-value {
    font-size: 17px;
  }

  .delivery-earning {
    padding: 19px;
  }

  .delivery-earning-amount {
    font-size: 30px;
  }
}


/* =========================================================
   TAVAEATS DELIVERY TEAM — TODAY EARNINGS V1
   ========================================================= */

.brand-team-area {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.earnings-trigger {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--brand-soft);
  padding: 8px 11px;
  color: var(--brand-deep);
  cursor: pointer;
  text-align: right;
  font: inherit;
  line-height: 1;
}

.earnings-trigger[hidden] {
  display: none;
}

#earnings-trigger-amount {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

#earnings-trigger-trips {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.earnings-trigger:focus-visible,
.earnings-close:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.earnings-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: flex;
  align-items: flex-end;
  justify-content: center;

  padding: 18px;
}

.earnings-modal[hidden] {
  display: none;
}

.earnings-backdrop {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  border: 0;
  background: rgba(23, 33, 29, 0.38);
  cursor: pointer;
}

.earnings-panel {
  position: relative;
  z-index: 1;

  width: min(100%, 430px);

  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);

  padding: 28px;
}

.earnings-eyebrow {
  margin: 0 0 8px;

  color: var(--brand);

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.earnings-panel h2 {
  margin: 0;

  color: var(--text);

  font-size: 24px;
  line-height: 1.15;
}

.earnings-total {
  margin-top: 18px;

  color: var(--brand-deep);

  font-size: 38px;
  line-height: 1;
  font-weight: 800;
}

.earnings-trip-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  margin-top: 26px;
  padding: 18px 0;

  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);

  color: var(--text-soft);
}

.earnings-trip-summary strong {
  color: var(--text);
}

.ready-finish-shift-button {
  display: block;
  width: fit-content;

  margin: 18px 0 0 auto;
  padding: 11px 18px;

  border: 2px solid var(--text);
  border-radius: 999px;

  background: #ffffff;
  color: var(--text);

  font: inherit;
  font-size: 0.92rem;
  font-weight: 750;

  cursor: pointer;
}

.ready-finish-shift-button:hover {
  background: var(--text);
  color: #ffffff;
}

.ready-finish-shift-button:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.ready-finish-shift-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.finish-shift-button {
  width: 100%;

  margin-top: 22px;
  padding: 15px 18px;

  border: 1px solid var(--border);
  border-radius: 14px;

  background: #ffffff;
  color: var(--text);

  font: inherit;
  font-weight: 750;

  cursor: pointer;
}

.finish-shift-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.earnings-close {
  width: 100%;

  margin-top: 12px;
  padding: 15px 18px;

  border: 0;
  border-radius: 14px;

  background: var(--brand);
  color: #ffffff;

  font: inherit;
  font-weight: 750;

  cursor: pointer;
}

@media (min-width: 700px) {
  .earnings-modal {
    align-items: center;
  }
}


/* =========================================================
   TAVAEATS DELIVERY ROUTE & MAP V1
   ========================================================= */

.delivery-map-workspace {
  display: grid;
  gap: 14px;

  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.delivery-map-heading {
  display: grid;
  gap: 5px;
}

.delivery-map-label {
  margin: 0;

  color: var(--brand);

  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.delivery-map-address {
  margin: 0;

  color: var(--text);

  font-size: 15px;
  line-height: 1.45;
  font-weight: 650;
}

.delivery-map {
  min-height: 220px;

  display: grid;
  place-items: center;

  overflow: hidden;

  background: var(--brand-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
}

.delivery-map-placeholder {
  margin: 0;
  padding: 24px;

  color: var(--text-soft);

  font-size: 14px;
  line-height: 1.5;
  font-weight: 650;
  text-align: center;
}

.delivery-navigate-button {
  width: 100%;
  min-height: 52px;

  appearance: none;

  border: 2px solid var(--brand);
  border-radius: var(--radius-medium);

  background: #ffffff;
  color: var(--brand-deep);

  font: inherit;
  font-size: 15px;
  font-weight: 800;

  cursor: pointer;
}

.delivery-navigate-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.delivery-navigate-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .delivery-map {
    min-height: 210px;
  }
}

/* =========================================================
   TAVAEATS EMBEDDED DELIVERY MAP OVERLAY V1
   ========================================================= */

body.tava-delivery-map-active {
  overflow: hidden;
}

body.tava-delivery-map-active .delivery-map-workspace {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 12px;

  width: 100%;
  height: 100dvh;

  padding:
    max(18px, env(safe-area-inset-top))
    16px
    max(18px, env(safe-area-inset-bottom));

  border: 0;
  background: #ffffff;
}

body.tava-delivery-map-active .delivery-map-heading {
  min-width: 0;
}

body.tava-delivery-map-active .delivery-map-address {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-live-route-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  min-height: 24px;

  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.delivery-live-route-summary strong {
  color: var(--brand);
  font-weight: 850;
}

.delivery-live-route-summary span {
  color: var(--text-soft);
  font-weight: 750;
  white-space: nowrap;
}

body.tava-delivery-map-active .delivery-map {
  width: 100%;
  min-height: 0;
  height: 100%;

  border-radius: var(--radius-medium);
}

body.tava-delivery-map-active
  .delivery-navigate-button {
  min-height: 48px;
}

body.tava-delivery-map-active
  .primary-action {
  width: 100%;
  min-height: 56px;
  margin: 0;
}

@media (min-width: 700px) {
  body.tava-delivery-map-active
    .delivery-map-workspace {
    left: 50%;
    right: auto;

    width: min(100%, 760px);

    transform: translateX(-50%);

    box-shadow:
      0 0 0 100vmax rgba(0, 0, 0, 0.18);
  }
}

@media (max-width: 520px) {
  body.tava-delivery-map-active
    .delivery-map {
    min-height: 0;
  }

  .delivery-live-route-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}


/* Delivery Partner registration — legal consent */
.legal-consent {
  display: grid;
  gap: 10px;
  margin: 4px 0 6px;
}

.consent-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid #dfe8e3;
  border-radius: 13px;
  background: #f8fbf9;
  font-size: 0.82rem;
  line-height: 1.42;
  color: #53605a;
  cursor: pointer;
}

.consent-row + .consent-row {
  margin-top: 0;
}

.consent-row:hover {
  border-color: #b8d4c7;
}

.consent-row input[type="checkbox"] {
  appearance: auto;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  padding: 0;
  flex: none;
  accent-color: #176b4d;
  cursor: pointer;
}

.consent-row span {
  min-width: 0;
}

.consent-row a {
  color: #176b4d;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.consent-row a:hover {
  text-decoration-thickness: 2px;
}

.consent-row:focus-within {
  border-color: #176b4d;
  box-shadow: 0 0 0 3px rgba(23, 107, 77, 0.10);
}

/* Long Delivery Partner registration heading only */
h1.registration-title {
  max-width: 100%;
  font-size: clamp(28px, 7vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  white-space: normal;
  overflow-wrap: normal;
}

