/* The customer's service tracking page (resources/views/service-track.blade.php) and its "link not found" page.
   Mobile first (360-430px), Premier Red accent, warm off-white background, white cards. */
:root {
    --red: #D71920;
    --red-dark: #B3121A;
    --red-soft: #FDEDED;
    --bg: #F7F4F0;
    --card: #FFFFFF;
    --ink: #1C1A18;
    --ink-2: #3E3A35;
    --muted: #6A645C;
    --line: #EDE8E2;
    --ok: #157A3B;
    --ok-soft: #E9F5EC;
    --warn: #A3530A;
    --warn-soft: #FDF2E3;
    --grey-soft: #F1EEEA;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(40, 25, 10, .04), 0 6px 20px rgba(40, 25, 10, .06);
    --focus: 0 0 0 3px rgba(215, 25, 32, .28);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.ic { flex-shrink: 0; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 10px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; max-width: 600px; margin: 0 auto; padding: 14px 16px; }
.top-logo img { display: block; height: 22px; width: auto; }
.top-help { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px; font-weight: 500; text-decoration: none; color: var(--ink-2); }

.wrap { max-width: 600px; margin: 0 auto; padding: 4px 16px 32px; display: grid; gap: 14px; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 16px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.card-title .ic { color: var(--ink-2); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-grey { background: var(--grey-soft); color: var(--ink-2); }
.badge-red { background: var(--red-soft); color: var(--red-dark); }

/* Hero */
.hero { position: relative; overflow: hidden; border-radius: var(--radius); padding: 22px 20px 20px; background: var(--card); box-shadow: var(--shadow); }
.hero.is-done { background: linear-gradient(135deg, #EAF6EE 0%, #F4FAF5 60%, #FFFFFF 100%); }
.hero.is-active { background: linear-gradient(135deg, #FDEFEF 0%, #FEF7F6 60%, #FFFFFF 100%); }
.hero.is-cancelled { background: linear-gradient(135deg, #EFECE8 0%, #F7F5F2 100%); }
.hero-ref { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.copy { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; min-width: 36px; justify-content: center; padding: 0 8px; border: 0; background: transparent; border-radius: 10px; color: var(--muted); cursor: pointer; letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.copy:hover { background: rgba(0, 0, 0, .05); color: var(--ink); }
.copy[data-copied] { color: var(--ok); }
.hero-main { display: flex; gap: 14px; align-items: flex-start; margin-top: 10px; }
.hero-icon { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.is-done .hero-icon { background: var(--ok); }
.is-active .hero-icon { background: var(--red); }
.is-cancelled .hero-icon { background: #8A847C; }
.hero h1 { font-size: 25px; line-height: 1.2; font-weight: 700; letter-spacing: -.025em; }
.is-done h1 { color: #0F5E2D; }
.hero-msg { margin-top: 6px; color: var(--ink-2); }
.hero-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.hero-meta .ic { color: var(--muted); }
.hero-product { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .78); }
.hero-product-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--red-soft); color: var(--red); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero-product-name { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.hero-product-sub { font-size: 13px; color: var(--muted); }

/* Timeline: horizontal steps */
.steps { list-style: none; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); position: relative; }
.step { position: relative; text-align: center; padding: 0 4px; }
.step::before { content: ''; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step.is-done::before, .step.is-now::before { background: var(--ok); }
.step-dot { position: relative; z-index: 1; width: 30px; height: 30px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; border: 2px solid #D9D3CB; color: #fff; }
.step.is-done .step-dot { background: var(--ok); border-color: var(--ok); }
.step.is-now .step-dot { border-color: var(--red); box-shadow: 0 0 0 5px var(--red-soft); }
.step.is-now .step-dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.step-label { margin-top: 10px; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.step.is-todo .step-label { color: var(--muted); font-weight: 500; }
.step-when { margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.35; }
@media (max-width: 389px) { .step-label { font-size: 12px; } .step-when { font-size: 11.5px; } .step { padding: 0 3px; } }

/* Technician */
.tech { display: flex; align-items: center; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--red-soft); color: var(--red); font-size: 20px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tech-body { flex: 1; min-width: 0; }
.tech-name { font-size: 17px; font-weight: 650; overflow-wrap: anywhere; }
.tech-role { font-size: 14px; color: var(--muted); }
.tech-state { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--ok); }
.icon-btn { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: #fff; color: var(--red); text-decoration: none; flex-shrink: 0; }
.icon-btn:hover { background: var(--red-soft); }
.note { display: flex; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--grey-soft); font-size: 14px; color: var(--ink-2); }
.note .ic { color: var(--muted); margin-top: 2px; }

/* The service code (while valid) */
.code-box { text-align: center; background: #FFF7F7; box-shadow: var(--shadow), inset 0 0 0 2px #F6C9CB; }
.code-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--red-dark); }
.code-digits { margin: 6px 0 4px; font-size: 38px; font-weight: 700; letter-spacing: .3em; padding-left: .3em; color: var(--ink); font-variant-numeric: tabular-nums; }
.code-help { font-size: 13.5px; color: var(--ink-2); }
.tech + .btn-ghost, .note + .btn-ghost { margin-top: 10px; }

/* Details */
.facts { display: grid; grid-template-columns: 1fr; gap: 14px; }
.fact { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.fact .ic { color: var(--muted); margin-top: 2px; }
.fact dt { font-size: 13px; color: var(--muted); }
.fact dd { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
@media (min-width: 400px) { .facts { grid-template-columns: 1fr 1fr; gap: 16px 18px; } .fact-wide { grid-column: 1 / -1; } }

/* Payment */
.lines { display: grid; }
.line { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; font-size: 15px; }
.line span:first-child { color: var(--ink-2); overflow-wrap: anywhere; }
.line span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-total { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); font-weight: 700; font-size: 16px; }
.line-total span:first-child { color: var(--ink); }
.line-total span:last-child { color: var(--red); font-size: 22px; letter-spacing: -.01em; }
.is-paid .line-total span:last-child { color: var(--ink); }
.pay-actions { margin-top: 16px; display: grid; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 20px; border-radius: 14px; border: 0; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color .15s ease, transform .1s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(215, 25, 32, .22); }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { min-height: 44px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.btn-ghost:hover { background: var(--grey-soft); }
.btn[aria-disabled="true"], .btn:disabled { opacity: .7; cursor: progress; }
.btn-block { width: 100%; }
.pay-trust { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.receipt { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--ok-soft); display: grid; gap: 6px; }
.receipt-head { display: flex; align-items: center; gap: 8px; font-weight: 650; color: #0F5E2D; }
.receipt-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.receipt-row span:first-child { color: var(--ink-2); }
.receipt-row span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.alert { display: flex; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.alert-warn { background: var(--warn-soft); color: #7A3E06; }
.alert-err { background: var(--red-soft); color: var(--red-dark); }
.alert .ic { margin-top: 2px; }

/* Spinner (buttons while working) */
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: none; }
[data-busy] .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } .btn { transition: none; } }

/* Feedback */
.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; border: 0; padding: 0; margin: 0; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; color: #D8D2CA; cursor: pointer; border-radius: 12px; }
.stars label .ic { width: 34px; height: 34px; fill: currentColor; stroke: currentColor; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #F2A516; }
.stars input:focus-visible + label { box-shadow: var(--focus); }
.stars-static { display: inline-flex; gap: 4px; }
.stars-static .ic { width: 26px; height: 26px; }
.stars-static .on { color: #F2A516; fill: #F2A516; }
.stars-static .off { color: #D8D2CA; fill: #D8D2CA; }
.fb-label { font-size: 14px; color: var(--ink-2); margin: 14px 0 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tag span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 14px; color: var(--ink-2); cursor: pointer; user-select: none; }
.tag input:checked + span { background: var(--red-soft); border-color: #F5C2C4; color: var(--red-dark); font-weight: 600; }
.tag input:focus-visible + span { box-shadow: var(--focus); }
.textarea { width: 100%; min-height: 92px; margin-top: 14px; padding: 12px 14px; border: 1px solid #DDD6CD; border-radius: 14px; font: inherit; color: var(--ink); resize: vertical; background: #fff; }
.textarea:focus { outline: none; border-color: var(--red); box-shadow: var(--focus); }
.fb-actions { margin-top: 14px; }
.thanks { display: flex; gap: 14px; align-items: center; }
.thanks-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.thanks-title { font-weight: 650; font-size: 17px; }

/* Help */
.help-sub { color: var(--ink-2); font-size: 14px; margin: -8px 0 14px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; }
.help-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: #fff; text-decoration: none; text-align: center; font-size: 14px; font-weight: 600; color: var(--ink); }
.help-btn small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.help-btn .ic { color: var(--red); }
.help-btn.is-wa .ic { color: #1C9A4B; }
.help-btn:hover { border-color: #E2DAD0; background: #FCFAF8; }
.links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 14px; }
.links a { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; font-size: 14px; font-weight: 500; color: var(--ink-2); }

.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 8px 16px 28px; }
.foot a { color: var(--muted); }

/* Link not found */
.missing { text-align: center; padding: 36px 22px; }
.missing .hero-icon { margin: 0 auto 14px; background: var(--grey-soft); color: var(--ink-2); width: 56px; height: 56px; }
.missing h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.missing p { color: var(--ink-2); margin-top: 8px; }
.missing .btn { margin-top: 20px; }

@media (min-width: 640px) {
    .wrap { padding-top: 8px; gap: 16px; }
    .card, .hero { padding: 24px; }
    .hero h1 { font-size: 28px; }
}

/* Finding one's service requests (resources/views/service-lookup.blade.php) */
.lookup-hero h1 { margin-top: 4px; }
.lookup-hero .hero-msg { margin-top: 8px; }
.field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field-help { font-size: 13px; color: var(--muted); margin-top: 6px; }
.input { width: 100%; min-height: 52px; padding: 0 14px; border: 1px solid #DDD6CD; border-radius: 14px; font: inherit; font-size: 17px; color: var(--ink); background: #fff; }
.input:focus { outline: none; border-color: var(--red); box-shadow: var(--focus); }
.input-code { font-size: 24px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.phone-field { display: flex; align-items: stretch; gap: 8px; }
.phone-prefix { display: inline-flex; align-items: center; padding: 0 14px; border-radius: 14px; background: var(--grey-soft); font-weight: 600; color: var(--ink-2); }
.form-btn { margin-top: 16px; }
.center { text-align: center; margin-top: 8px; }
.link-quiet { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--ink-2); }
.req-list { list-style: none; display: grid; gap: 4px; margin: -6px -8px; }
.req { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-radius: 14px; text-decoration: none; color: var(--ink); }
.req:hover { background: #FBF8F5; }
.req + .req, .req-list li + li { border-top: 1px solid var(--line); }
.req-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--red-soft); color: var(--red); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.req-body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.req-no { font-weight: 650; }
.req-product { font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-date { font-size: 13px; color: var(--muted); }
.req-go { color: var(--muted); }
.register-card { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.register-card:hover { background: #FCFAF8; }
