/* Created by Kamran Namazov on 06/10/2026. DrivIQ web (Service Pass). Colours = app DesignSystem palette. */

:root {
  --canvas: #F3F5F9;
  --surface: #FFFFFF;
  --surface-muted: #E8EDF4;
  --line: #DDE3EC;
  --ink: #0B2447;
  --ink-2: #55627A;
  --ink-3: #9099A8;
  --volt: #C8F03C;
  --red: #E5484D;
  --danger: #B42318;
  --green: #16A66A;
  --amber: #B45309;
  --radius: 16px;
  --radius-sm: 10px;
  --gap: 12px;
  --pad: 20px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
[hidden] { display: none !important; }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 18px) var(--pad) 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.logo {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--ink); color: var(--volt); font-weight: 800; font-size: 15px;
}
.host { color: var(--ink-3); font-size: 14px; }

main { max-width: 520px; margin: 0 auto; padding: 16px var(--pad) calc(env(safe-area-inset-bottom) + 32px); }

/* Car card */
.car {
  display: flex; align-items: center; justify-content: space-between; gap: var(--gap);
  background: var(--ink); color: #fff; border-radius: var(--radius); padding: 16px;
}
.car-name { font-size: 18px; font-weight: 700; }
.car-sub { font-size: 13px; opacity: .72; margin-top: 2px; }
.car-valid { color: var(--volt); font-size: 13px; font-weight: 600; white-space: nowrap; }

h1 { font-size: 24px; line-height: 1.2; margin: 14px 0 6px; }
h2 { font-size: 22px; line-height: 1.25; margin: 16px 0 6px; }
.lead { color: var(--ink-2); margin: 0 0 12px; }
.muted { color: var(--ink-2); margin: 0; }

form { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }

/* Fields: white cards with a small label */
.field {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 0; min-width: 0;
}
.field:focus-within { border-color: var(--ink); }
.field.invalid { border-color: var(--red); }
.label { font-size: 13px; color: var(--ink-2); padding: 0; }
.req { color: var(--red); font-weight: 600; }
.hint { font-size: 12px; color: var(--amber); font-weight: 600; }
input, textarea, button { font: inherit; color: inherit; }
.field input, .field textarea {
  border: 0; outline: 0; background: transparent; padding: 0; width: 100%;
  font-size: 17px; font-weight: 600; min-height: 26px;
}
.field textarea { resize: vertical; font-weight: 500; }
::placeholder { color: var(--ink-3); font-weight: 500; }
input[type="date"] { -webkit-appearance: none; appearance: none; min-height: 26px; }

/* Work lines */
.lines { gap: 8px; }
/* A fieldset legend sits on the border by default; float it inside like the other labels. */
.lines legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; }
.lines legend + * { clear: both; }
.line { display: grid; grid-template-columns: 1fr 76px 28px; gap: 8px; align-items: center; }
.line .other { grid-column: 1 / -1; }
.line select, .line input {
  background: var(--canvas); border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 16px; font-weight: 500; min-width: 0; width: 100%;
}
.line select:focus, .line input:focus { border-color: var(--ink); outline: 0; }
.line select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 30px; text-overflow: ellipsis;
  background: var(--canvas) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2355627A' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.line select.empty { color: var(--ink-3); }
.line select option { color: var(--ink); }
.line .price { text-align: right; font-weight: 600; }
.line .bad { border-color: var(--red); }
.remove {
  border: 0; background: transparent; color: var(--ink-3); font-size: 22px; line-height: 1;
  width: 28px; height: 36px; cursor: pointer;
}
.total { display: flex; justify-content: space-between; align-items: center; font-weight: 700; padding-top: 4px; }
.total-value { display: flex; align-items: center; gap: 8px; }
.currency {
  -webkit-appearance: none; appearance: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 26px 4px 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2355627A' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 9px center;
}

.link {
  align-self: flex-start; border: 0; background: transparent; padding: 6px 0;
  font-weight: 600; color: var(--ink); cursor: pointer;
}
.link.danger { color: var(--danger); }

/* Receipt */
.receipt { border: 1.5px dashed var(--ink-3); border-radius: var(--radius); background: transparent; }
.receipt-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px; cursor: pointer; }
.receipt-title { font-weight: 600; }
.receipt-hint { font-size: 13px; color: var(--ink-3); }
.receipt-chosen { display: flex; gap: var(--gap); align-items: center; padding: 12px; }
.receipt-chosen img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-muted); }
.receipt-actions { display: flex; flex-direction: column; }

.captcha { min-height: 65px; }

.primary {
  width: 100%; border: 0; border-radius: 999px; padding: 16px; cursor: pointer;
  background: var(--ink); color: #fff; font-size: 18px; font-weight: 600;
}
.primary:disabled { opacity: .55; cursor: default; }
.primary:active:not(:disabled) { opacity: .85; }
.error { color: var(--danger); font-weight: 600; margin: 0; }
.fine { color: var(--ink-3); font-size: 12px; margin: 0; }

/* Result pages */
.state { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 80px; gap: 4px; }
.badge {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-muted); font-size: 30px;
}
.badge.ok { background: var(--volt); color: var(--ink); font-weight: 800; }
.promo {
  margin-top: 16px; width: 100%; text-align: left; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.promo p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }
.state .primary { margin-top: 20px; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--ink);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.noscript { padding: var(--pad); text-align: center; }

@media (max-width: 360px) {
  .row { grid-template-columns: 1fr; }
  .line { grid-template-columns: 1fr 68px 24px; }
}
