/**
 * Ordivity Drivers — public application styles (light theme).
 *
 * Tokens matched to ordivity-storefront.css so a driver and a customer are
 * plainly on the same platform:
 *   surface   #f4f5f7      card #fff      border #eceef1
 *   text      #1f2937      heading #111827   muted #6b7280
 *   accent    #22c55e      hover #16a34a     deep #15803d
 *   danger    #dc2626      warn #b45309
 *   radius    12px cards, 10px controls     shadow 0 1px 2px rgba(0,0,0,.05)
 *
 * Values are replicated rather than imported so this plugin is correctly
 * styled with Ordivity Ordering inactive — the same rule ordivity-dashboard.css
 * follows for the Loyalty tokens.
 *
 * @version 0.1.0
 */

/* GLOBAL [hidden] GUARD. Keep this at the top of every platform stylesheet.
   The `hidden` attribute is honoured by a USER-AGENT rule, so ANY author rule
   that sets `display` beats it outright regardless of specificity — a single
   `.thing { display: flex }` silently turns `el.hidden = true` into a no-op.
   This has bitten the storefront twice. One global rule cannot be forgotten. */
[hidden] { display: none !important; }

.drv-page * { box-sizing: border-box; margin: 0; padding: 0; }

.drv-page {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	background: #f4f5f7;
	color: #1f2937;
	line-height: 1.5;
	min-height: 100vh;
	padding: 0 0 64px;
}

/* Header ------------------------------------------------------------------ */
.drv-header { background: #fff; border-bottom: 1px solid #eceef1; }
.drv-header-inner { max-width: 640px; margin: 0 auto; padding: 20px 18px; }
.drv-kicker { font-size: 0.7rem; letter-spacing: 0.08em; color: #9ca3af; font-weight: 700; text-transform: uppercase; }
.drv-header h1 { font-size: 1.4rem; color: #111827; margin: 4px 0 2px; }
.drv-header p { font-size: 0.9rem; color: #6b7280; }

.drv-wrap { max-width: 640px; margin: 0 auto; padding: 18px; }

/* Progress ---------------------------------------------------------------- */
.drv-progress { display: flex; gap: 6px; margin: 0 0 18px; }
.drv-progress-step { flex: 1 1 0; height: 6px; border-radius: 999px; background: #e5e7eb; }
.drv-progress-step.is-done { background: #22c55e; }
.drv-progress-step.is-current { background: #86efac; }

/* Cards ------------------------------------------------------------------- */
.drv-card {
	background: #fff;
	border: 1px solid #eceef1;
	border-radius: 12px;
	padding: 20px 18px;
	margin-bottom: 16px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.drv-card h2 { font-size: 1.1rem; color: #111827; margin-bottom: 6px; }
.drv-card > p { font-size: 0.9rem; color: #6b7280; margin-bottom: 14px; }

/* Fields ------------------------------------------------------------------ */
.drv-field { margin-bottom: 14px; }
/* v1.30.0 — three dimension inputs side by side (capacity gate). */
.drv-field-row { display: flex; gap: 10px; }
.drv-field-row .drv-field { flex: 1 1 0; min-width: 0; }
.drv-field label { display: block; font-size: 0.82rem; font-weight: 600; color: #374151; margin-bottom: 6px; }
.drv-field .drv-hint { display: block; font-size: 0.78rem; color: #9ca3af; font-weight: 400; margin-top: 4px; }

.drv-page input[type="text"],
.drv-page input[type="tel"],
.drv-page input[type="date"],
.drv-page input[type="password"],
.drv-page input[type="number"],
.drv-page select {
	width: 100%;
	padding: 11px 12px;
	font-size: 16px; /* 16px stops iOS zooming the whole page on focus. */
	font-family: inherit;
	color: #1f2937;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	outline: none;
}
.drv-page input:focus,
.drv-page select:focus { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15); }
.drv-page input[aria-invalid="true"] { border-color: #dc2626; }

/* The honeypot. Never display:none — some bots skip hidden fields, and a
   screen reader is told to ignore it via aria-hidden and tabindex instead. */
.drv-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px; height: 1px; overflow: hidden;
}

/* Choice chips ------------------------------------------------------------ */
.drv-choices { display: flex; gap: 10px; flex-wrap: wrap; }
.drv-choice {
	flex: 1 1 140px;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	padding: 12px;
	background: #fff;
	cursor: pointer;
	text-align: left;
	font-size: 0.9rem;
	color: #374151;
	font-family: inherit;
}
.drv-choice.is-selected { border-color: #22c55e; background: rgba(34, 197, 94, 0.06); color: #15803d; font-weight: 600; }

/* Buttons ----------------------------------------------------------------- */
.drv-btn {
	display: inline-block;
	width: 100%;
	padding: 13px 18px;
	font-size: 0.95rem;
	font-weight: 700;
	font-family: inherit;
	border: none;
	border-radius: 10px;
	background: #22c55e;
	color: #06210f;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
}
.drv-btn:hover { background: #16a34a; }
.drv-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.drv-btn-secondary { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.drv-btn-secondary:hover { background: #f9fafb; }
.drv-actions { display: flex; gap: 10px; margin-top: 6px; }

/* Documents --------------------------------------------------------------- */
.drv-docs { display: flex; flex-direction: column; gap: 10px; }
.drv-doc {
	display: flex; align-items: center; gap: 12px;
	border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px;
}
.drv-doc-body { flex: 1 1 auto; min-width: 0; }
.drv-doc-name { font-size: 0.9rem; font-weight: 600; color: #374151; }
.drv-doc-state { font-size: 0.78rem; color: #9ca3af; }
.drv-doc.is-done { border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.04); }
.drv-doc.is-done .drv-doc-state { color: #15803d; }
.drv-doc.is-expired { border-color: rgba(220, 38, 38, 0.4); background: rgba(220, 38, 38, 0.04); }
.drv-doc.is-expired .drv-doc-state { color: #dc2626; }
.drv-doc-tick { font-size: 1.1rem; width: 22px; text-align: center; }
.drv-doc-pick {
	flex: 0 0 auto;
	padding: 9px 14px; font-size: 0.85rem; font-weight: 600; font-family: inherit;
	border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: #374151; cursor: pointer;
}
.drv-doc-pick:hover { background: #f9fafb; }
.drv-doc input[type="file"] { display: none; }

/* Consent ----------------------------------------------------------------- */
.drv-consent { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.drv-consent input[type="checkbox"] { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; }
.drv-consent label { font-size: 0.85rem; color: #374151; line-height: 1.45; }
.drv-consent a { color: #15803d; }

/* Status messages --------------------------------------------------------- */
.drv-status {
	border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
	font-size: 0.88rem; border: 1px solid transparent;
}
.drv-status-error { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.25); color: #991b1b; }
.drv-status-ok { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.3); color: #15803d; }
.drv-status-info { background: rgba(59, 130, 246, 0.08); border-color: rgba(59, 130, 246, 0.25); color: #1d4ed8; }

.drv-note { font-size: 0.8rem; color: #9ca3af; margin-top: 12px; }
.drv-summary { list-style: none; font-size: 0.88rem; color: #374151; }
.drv-summary li { padding: 8px 0; border-bottom: 1px solid #f3f4f6; display: flex; justify-content: space-between; gap: 12px; }
.drv-summary li:last-child { border-bottom: none; }
.drv-summary .drv-summary-value { color: #6b7280; text-align: right; }

/* Closed / error shells ---------------------------------------------------- */
.drv-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.drv-shell-box { background: #fff; border-radius: 16px; padding: 32px; text-align: center; max-width: 380px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08); }
.drv-shell-box h1 { font-size: 1.2rem; color: #111827; margin-bottom: 10px; }
.drv-shell-box p { font-size: 0.9rem; color: #6b7280; }

/* Vendor recruitment panel (also used inside the Phase 2 Drivers tab) ------- */
.drv-panel { background: #fff; border: 1px solid #eceef1; border-radius: 12px; padding: 20px; text-align: center; }
.drv-panel-title { font-size: 1.05rem; color: #111827; margin-bottom: 6px; }
.drv-panel-note { font-size: 0.85rem; color: #6b7280; margin-bottom: 14px; }
.drv-panel-warn { font-size: 0.85rem; color: #b45309; margin-bottom: 10px; }
/* Preview is a fixed 120px (matching the loyalty/ordering sign-up QR). The
   inline width/height on the <img> is authoritative; this caps it should the
   attributes ever be dropped. */
.drv-qr img { width: 120px; height: 120px; max-width: 100%; }
.drv-panel-actions { margin-top: 14px; display: flex; justify-content: center; }
/* Self-contained button styling for the shortcode/PWA context, where only this
   base stylesheet loads. Inside the Drivers tab the .drv-dash-btn rule (dashboard
   stylesheet) already styles it; there this just removes the anchor underline. */
.drv-panel-dl { display: inline-block; padding: 10px 16px; font-size: 0.88rem; font-weight: 700; border-radius: 10px; background: #22c55e; color: #000; text-decoration: none; }
.drv-panel-dl:hover { background: #16a34a; }
.drv-panel-link { font-size: 0.8rem; word-break: break-all; margin-top: 12px; }
.drv-panel-link a { color: #15803d; }
.drv-panel-locked { background: #fff; border: 1px dashed #d1d5db; border-radius: 12px; padding: 20px; text-align: center; color: #6b7280; font-size: 0.9rem; }

@media (min-width: 700px) {
	.drv-header-inner, .drv-wrap { padding-left: 24px; padding-right: 24px; }
}

/* v0.8.2 — the Done screen's hand-off to the app.
   display:inline-block is not cosmetic: width and padding are NO-OPS on an
   inline <a>, which is how this platform has shipped a full-width button that
   rendered as a text link before. */
.drv-btn-block {
	display: inline-block;
	width: 100%;
	text-align: center;
	text-decoration: none;
	box-sizing: border-box;
	margin-top: 4px;
}

/* v0.8.3 — device recovery card. */
.drv-rule { border: none; border-top: 1px solid #e5e7eb; margin: 20px 0 16px; }
.drv-subhead { font-size: 0.95rem; font-weight: 700; color: #111827; margin: 0 0 4px; }
