/* Contractor Portal (www/contractor/, loaded after portal.css by templates/includes/contractor/head.html): the portal's
   look with the Rehab orange accent, glass cards, big thumb-size buttons and a sticky bottom bar on phones. Light and
   dark follow portal.css's tokens (portal_theme.js's choice, else the device's setting). */
:root { --rf-orange: #f97316; --rf-orange-ink: #c2410c; --rf-orange-soft: #fff1e6; --rf-glass: rgba(255, 255, 255, 0.72);
	--rf-glass-line: rgba(255, 255, 255, 0.9); --rf-shadow: 0 10px 30px rgba(15, 15, 30, 0.08); --rf-bar: rgba(255, 255, 255, 0.82); }
:root[data-theme="dark"] { --rf-orange-ink: #fdba74; --rf-orange-soft: #3a1d0e; --rf-glass: rgba(28, 28, 30, 0.72);
	--rf-glass-line: rgba(255, 255, 255, 0.08); --rf-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); --rf-bar: rgba(28, 28, 30, 0.82); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) { --rf-orange-ink: #fdba74; --rf-orange-soft: #3a1d0e; --rf-glass: rgba(28, 28, 30, 0.72);
		--rf-glass-line: rgba(255, 255, 255, 0.08); --rf-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); --rf-bar: rgba(28, 28, 30, 0.82); }
}

body.rf-contractor { min-height: 100vh; background:
	radial-gradient(1200px 500px at 100% -10%, color-mix(in srgb, var(--rf-orange) 16%, transparent), transparent 70%),
	radial-gradient(900px 400px at -10% 0%, color-mix(in srgb, #2563eb 8%, transparent), transparent 70%), var(--page);
	background-attachment: fixed; }
.rf-contractor .rf-wrap { padding-bottom: 32px; }
.rf-contractor h2 { margin: 0 0 10px; font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }
.rf-contractor h3 { margin: 10px 0 4px; font-size: 18px; } .rf-contractor h4 { margin: 14px 0 4px; font-size: 15px; }
.rf-contractor .rf-switch a[aria-current="page"], .rf-contractor .rf-theme button[aria-pressed="true"],
.rf-contractor .rf-gear[aria-expanded="true"], .rf-contractor .rf-auth.rf-login { background: var(--rf-orange); color: #fff; }
.rf-contractor .rf-nav a.on { color: var(--rf-orange-ink); }
.rf-contractor :focus-visible { outline: 3px solid var(--rf-orange); outline-offset: 2px; }

/* Glass cards */
.rf-glass { background: var(--rf-glass); border: 1px solid var(--rf-glass-line); box-shadow: var(--rf-shadow);
	-webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); border-radius: 22px; overflow: hidden; }

/* Buttons: the orange "go" button, big enough for a thumb */
.rf-contractor .rf-btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	transition: transform 0.08s ease, opacity 0.2s; -webkit-tap-highlight-color: transparent; }
.rf-contractor .rf-btn:active { transform: scale(0.97); }
.rf-btn.rf-go { background: var(--rf-orange); color: #fff; }
.rf-btn.rf-wide { width: 100%; }
.rf-back { display: inline-block; margin: 0 0 12px; color: var(--muted); text-decoration: none; font-weight: 700; }

/* Home: greeting and counts */
.rf-hello { margin: 4px 0 18px; }
.rf-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.rf-counts a { display: block; padding: 12px 14px; border-radius: 18px; background: var(--rf-glass); border: 1px solid var(--rf-glass-line);
	text-decoration: none; -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.rf-counts b { display: block; font-size: 28px; font-weight: 900; letter-spacing: -0.03em; color: var(--rf-orange-ink); }
.rf-counts span { font-size: 13px; color: var(--muted); font-weight: 700; }
.rf-section { margin: 26px 0; scroll-margin-top: 16px; }
.rf-done summary { list-style: none; cursor: pointer; } .rf-done summary::-webkit-details-marker { display: none; }
.rf-done summary h2::after { content: "▾"; margin-left: 8px; color: var(--muted); font-size: 16px; }
.rf-done[open] summary h2::after { content: "▴"; }
.rf-done summary .rf-pill { margin: 0 0 0 6px; vertical-align: middle; }

/* Job cards */
.rf-jobs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.rf-job { position: relative; }
.rf-job[aria-busy="true"] { opacity: 0.75; }
.rf-job-photo { position: relative; display: block; }
.rf-job-photo img, .rf-job-photo .rf-nophoto, .rf-house img, .rf-house .rf-nophoto { display: block; width: 100%; aspect-ratio: 16 / 10;
	object-fit: cover; }
.rf-job-photo img, .rf-house img { background: var(--line); }
/* No photo yet: the Flip Ohio logo, muted (flip-ohio-placeholder-light.svg; -dark.svg under the dark theme and Auto in dark mode) on the
   orange-soft gradient; both ends are theme tokens, so dark mode stays dark. */
.rf-nophoto { background: url("/assets/erpnext_wholesaling/images/flip-ohio-placeholder-light.svg") center / auto 60% no-repeat, linear-gradient(135deg, var(--rf-orange-soft), var(--line)); }
:root[data-theme="dark"] .rf-nophoto { background-image: url("/assets/erpnext_wholesaling/images/flip-ohio-placeholder-dark.svg"), linear-gradient(135deg, var(--rf-orange-soft), var(--line)); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .rf-nophoto { background-image: url("/assets/erpnext_wholesaling/images/flip-ohio-placeholder-dark.svg"), linear-gradient(135deg, var(--rf-orange-soft), var(--line)); }
}
.rf-job-photo .rf-state { position: absolute; left: 12px; top: 12px; margin: 0; background: rgba(0, 0, 0, 0.62); color: #fff;
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.rf-job .rf-inner { padding: 14px 16px 18px; }
.rf-job-title { display: block; font-size: 18px; font-weight: 800; line-height: 1.25; text-decoration: none; }
.rf-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; } .rf-tags .rf-pill { margin: 0; }
.rf-cat { background: var(--rf-orange-soft) !important; color: var(--rf-orange-ink); }
.rf-sev-cosmetic { color: var(--muted); } .rf-sev-minor { color: #2563eb; }
.rf-sev-major { background: #fef3c7 !important; color: #92400e; } .rf-sev-safety { background: #fee2e2 !important; color: #b91c1c; }
:root[data-theme="dark"] .rf-sev-major { background: #3b2a06 !important; color: #fcd34d; }
:root[data-theme="dark"] .rf-sev-safety { background: #3f0d0d !important; color: #fca5a5; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .rf-sev-major { background: #3b2a06 !important; color: #fcd34d; }
	:root:not([data-theme="light"]) .rf-sev-safety { background: #3f0d0d !important; color: #fca5a5; }
}
.rf-ai { margin: 8px 0; }
.rf-est { margin-top: 6px; font-weight: 800; color: var(--close); }
.rf-myquote { margin: 8px 0 0; font-weight: 800; color: var(--rf-orange-ink); flex-basis: 100%; }

/* The job's buttons, shown by its state (data-state; contractor_portal.job_state) */
.rf-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 12px; }
.rf-actions .rf-btn { margin: 0; }
.rf-fold > summary { list-style: none; } .rf-fold > summary::-webkit-details-marker { display: none; }
.rf-fold[open] { flex-basis: 100%; }
.rf-fold[open] > summary { opacity: 0.6; }
.rf-job .rf-if-quote, .rf-job .rf-if-pass, .rf-job .rf-if-sent, .rf-job .rf-if-start, .rf-job .rf-if-finish, .rf-job .rf-when-sent { display: none; }
.rf-job:is([data-state="requested"], [data-state="submitted"], [data-state="passed"]) .rf-if-quote { display: block; }
.rf-job:is([data-state="requested"], [data-state="submitted"]) .rf-if-pass { display: inline-flex; }
.rf-job[data-state="submitted"] .rf-if-sent { display: block; }
.rf-job[data-state="submitted"] .rf-when-sent { display: inline; }
.rf-job[data-state="submitted"] .rf-when-new { display: none; }
.rf-job[data-state="approved"] .rf-if-start { display: inline-flex; }
.rf-job:is([data-state="approved"], [data-state="in_progress"]) .rf-if-finish { display: block; }
.rf-form { margin-top: 10px; padding: 14px; border-radius: 16px; background: var(--page); }
.rf-form input, .rf-form textarea, .rf-form select { background: var(--card); min-height: 48px; font-size: 16px; }
.rf-form label:first-child { margin-top: 0; }
.rf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

/* Camera capture */
.rf-capture { position: relative; display: flex; align-items: center; gap: 14px; margin: 0; padding: 14px; border-radius: 16px;
	border: 2px dashed color-mix(in srgb, var(--rf-orange) 55%, transparent); background: var(--card); cursor: pointer; font-weight: 400; }
.rf-capture input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.rf-capture-face { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--rf-orange); color: #fff; }
.rf-capture small { display: block; color: var(--muted); font-size: 13px; }
.rf-capture:focus-within { outline: 3px solid var(--rf-orange); outline-offset: 2px; }
.rf-preview-img { display: block; width: 100%; max-height: 260px; object-fit: cover; margin-top: 10px; border-radius: 14px; }

/* Job page */
.rf-job-page .rf-inner { padding: 18px 20px 22px; }
.rf-job-page h1 { font-size: 28px; margin-top: 10px; }
.rf-job-page > .rf-inner > .rf-state { margin: 0; background: var(--rf-orange); color: #fff; }
.rf-ba { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; }
.rf-ba figure { position: relative; margin: 0; }
.rf-ba figure[hidden] { display: none; }
.rf-ba img, .rf-ba .rf-nophoto { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.rf-ba img { background: var(--line); }
.rf-ba figcaption { position: absolute; left: 10px; bottom: 10px; padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.6);
	color: #fff; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.rf-strip { display: flex; gap: 6px; overflow-x: auto; padding: 6px; scroll-snap-type: x mandatory; }
.rf-strip img { flex: none; width: 128px; height: 96px; object-fit: cover; border-radius: 12px; scroll-snap-align: start; background: var(--line); }
.rf-big-line { font-size: 18px; font-weight: 800; color: var(--close); }
.rf-contact { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; } .rf-contact .rf-btn { margin: 0; flex: 1 1 auto; }
.rf-contractor section.rf-card { margin-top: 16px; }

/* How-to checklist */
.rf-steps ol { list-style: none; counter-reset: step; margin: 8px 0 0; padding: 0; }
.rf-steps li { counter-increment: step; border-top: 1px solid var(--line); }
.rf-step { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 12px 0; font-weight: 400; font-size: 16px; cursor: pointer; }
.rf-step input { flex: none; width: 26px; height: 26px; margin: 0; accent-color: var(--rf-orange); }
.rf-step span::before { content: counter(step) ". "; font-weight: 800; color: var(--rf-orange-ink); }
.rf-step input:checked + span { color: var(--muted); text-decoration: line-through; }
.rf-progress { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.rf-progress i { display: block; height: 100%; width: 0; background: var(--rf-orange); transition: width 0.3s ease; }

/* Materials with Shop links */
.rf-materials { list-style: none; margin: 8px 0; padding: 0; }
.rf-materials li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rf-materials small { display: block; color: var(--muted); }
.rf-btn.rf-shop { min-height: 40px; padding: 8px 16px; margin: 0; }

/* Houses */
.rf-houses { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.rf-house { display: block; text-decoration: none; }
.rf-house .rf-inner { padding: 12px 16px 16px; }
.rf-house-hero .rf-cover { position: relative; }
.rf-house-hero .rf-cover img, .rf-house-hero .rf-cover .rf-nophoto { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
/* The title sits over the bottom of the cover, so the house sits a little high. */
.rf-house-hero .rf-cover .rf-nophoto { background-position: center 30%, center; background-size: auto 58%, auto; }
.rf-cover-text { position: absolute; inset: auto 0 0 0; padding: 40px 20px 16px; color: #fff;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.72)); }
.rf-cover-text h1 { margin: 0; font-size: 26px; color: #fff; }

/* Found another issue? */
.rf-tag { scroll-margin-top: 16px; }
.rf-seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; border: 0; }
.rf-seg legend { width: 100%; margin-bottom: 6px; font-weight: 700; font-size: 14px; }
.rf-seg label { margin: 0; } .rf-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rf-seg span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px; background: var(--card);
	border: 1px solid var(--line); font-weight: 700; cursor: pointer; }
.rf-seg input:checked + span { background: var(--rf-orange); border-color: var(--rf-orange); color: #fff; }
.rf-seg input:focus-visible + span { outline: 3px solid var(--rf-orange); outline-offset: 2px; }
.rf-voice { display: grid; gap: 8px; }
.rf-mic.on { background: #dc2626; color: #fff; animation: rf-pulse 1.2s ease-in-out infinite; }
@keyframes rf-pulse { 50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.18); } }
.rf-result { margin-top: 12px; padding: 16px; border-radius: 16px; background: var(--page); }
.rf-result ol { padding-left: 22px; } .rf-result li { margin: 4px 0; }
.rf-result .rf-btn { margin: 12px 10px 0 0; }

/* Toast and offline queue */
.rf-toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 50; max-width: min(92vw, 520px);
	padding: 12px 18px; border-radius: 16px; background: var(--ink); color: var(--card); font-weight: 700; box-shadow: var(--rf-shadow);
	transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.rf-toast.on { opacity: 1; transform: translate(-50%, 0); }
.rf-toast[data-kind="error"] { background: #b91c1c; color: #fff; }
.rf-queue { margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: var(--banner); color: var(--banner-ink); font-weight: 700; }
.rf-queue[hidden] { display: none; }

/* Bottom bar on phones: Jobs · Houses · Tag issue */
.rf-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(3, 1fr);
	padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--rf-bar); border-top: 1px solid var(--line);
	-webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8); }
.rf-bar a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center;
	color: var(--muted); font-size: 12px; font-weight: 800; text-decoration: none; border-radius: 14px; }
.rf-bar a.on { color: var(--rf-orange-ink); }
.rf-bar svg { width: 24px; height: 24px; }
.rf-bar .rf-bar-tag { color: #fff; background: var(--rf-orange); margin: 2px 6px; }
body.rf-contractor { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 760px) {
	.rf-bar { display: none; }
	body.rf-contractor { padding-bottom: 0; }
	.rf-toast { bottom: 24px; }
}
@media (max-width: 420px) {
	.rf-contractor h1 { font-size: 28px; }
	.rf-jobs { grid-template-columns: 1fr; }
	.rf-actions .rf-btn, .rf-actions .rf-fold { flex: 1 1 100%; }
	.rf-actions .rf-fold > summary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .rf-contractor * { transition: none !important; animation: none !important; } }
