/* Murrieta Valley Epoxy additions on top of the shared demo styles */

html.is-loading main, html.is-loading .site-header, html.is-loading .footer { visibility: hidden; }

/* Logo: Dalmatian lockup (transparent PNG) or fallback monogram */
.logo { gap: 10px; }
.n51-mark { width: 40px; height: 44px; flex: none; display: block; }
.n51-logo-img { height: 66px; width: auto; max-width: 100px; object-fit: contain; flex: none; display: block; border-radius: 0; }
.logo .logo__word { font-family: var(--font-head); font-weight: 600; letter-spacing: .02em; font-size: .92rem; line-height: 1.15; white-space: normal; max-width: 11em; }
.logo .logo__word-accent { display: block; letter-spacing: .12em; text-transform: uppercase; font-size: .75rem; color: var(--armor); }
.site-header.is-scrolled .n51-mark { width: 34px; height: 37px; }
.site-header.is-scrolled .n51-logo-img { height: 56px; max-width: 86px; }
.logo--footer .n51-mark { width: 34px; height: 37px; }
.logo--footer .n51-logo-img { height: 70px; max-width: 108px; }
@media (max-width: 640px) {
  .n51-logo-img { height: 54px; max-width: 84px; }
  .site-header.is-scrolled .n51-logo-img { height: 52px; max-width: 80px; }
}
@media (max-width: 340px) { .site-header .logo .logo__word { display: none; } }

.header-phone { font-family: var(--font-mono); font-size: .85rem; text-decoration: none; white-space: nowrap; color: var(--navy); opacity: .88; }
.header-phone:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }

/* Hero badge center shows the logo mark */
.hero__badge-logo { display: grid; place-items: center; }
.hero__badge-logo .n51-mark { width: 40px; height: 44px; }
.hero__badge-logo .n51-logo-img { height: 48px; max-width: 64px; }

/* Estimate form in the hero */
#estimate { scroll-margin-top: 96px; }
.estimate-form.quick-quote:hover { transform: none; box-shadow: none; border-color: var(--line); }
.estimate-form .fields { display: grid; gap: 12px; }
.estimate-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .estimate-form__row { grid-template-columns: 1fr; } }
.estimate-form .field { display: grid; gap: 6px; }
.estimate-form .field label { font-size: .875rem; font-weight: 500; }
.estimate-form .field input,
.estimate-form .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: #FFFFFF;
  font: inherit; font-size: 1rem; color: var(--black); transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.estimate-form .field input { min-height: 48px; padding-top: 0; padding-bottom: 0; }
.estimate-form .field textarea { min-height: 88px; resize: vertical; }
.estimate-form .field input:hover, .estimate-form .field textarea:hover { border-color: rgba(0, 27, 116, .35); }
.estimate-form .field input:focus, .estimate-form .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0, 27, 116, .12); }
.estimate-form .field input[aria-invalid="true"] { border-color: var(--error); }
.estimate-form .field__err { font-size: .8125rem; color: var(--error); }
.estimate-form .field__hint { font-weight: 400; color: var(--armor); }
.estimate-form__foot { padding-top: 4px; }
.estimate-form__foot .btn { width: 100%; }
.est-error { font-size: .875rem; color: var(--error); }
.estimate-form__done { display: grid; gap: 8px; }
.estimate-form__done[hidden] { display: none; }
.estimate-form__thanks { font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #FFFFFF; animation: spin 700ms linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Reviews (only shown when the owner adds some) */
[data-reviews] { display: grid; gap: 14px; }
[data-reviews]:empty { display: none; }
.stars svg { width: 16px; height: 16px; fill: currentColor; }

/* Contact */
.contact__card {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px 56px; align-items: center;
  padding: clamp(22px, 4vw, 40px); border-radius: 22px; background: var(--surface); border: 1px solid var(--line);
}
.contact__copy { display: grid; gap: 14px; justify-items: start; }
.contact__copy h2 { font-size: var(--fs-h2); }
.contact__text { color: var(--armor); max-width: 46ch; }
.contact__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.contact__list li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact__list li:last-child { border-bottom: 0; }
.contact__list svg { flex: none; width: 22px; height: 22px; margin-top: 2px; }
.contact__list div { display: grid; gap: 2px; min-width: 0; }
.contact__label { font-family: var(--font-mono); font-size: .6875rem; text-transform: uppercase; letter-spacing: .1em; color: var(--armor); }
.contact__list a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.contact__list a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) { .contact__card { grid-template-columns: minmax(0, 1fr); } }

/* Phone bar: call button + estimate */
@media (max-width: 720px) {
  .mobile-cta { display: flex; gap: 10px; }
  .mobile-cta .btn { width: auto; }
  .mobile-cta .btn:last-child { flex: 1; }
  .mobile-cta .mobile-cta__call { width: 50px; min-width: 50px; flex: none; padding: 0; color: var(--black); }
}


/* ---------- Dashboard: sign in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px var(--gutter-r) 32px var(--gutter-l); background: var(--chalk); }
.auth__card { width: min(420px, 100%); display: grid; gap: 14px; padding: 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--haze); box-shadow: var(--shadow); }
.auth__logo { display: flex; align-items: center; gap: 12px; }
.auth__card h1 { font-size: 1.6rem; }
.auth__lede { color: var(--armor); font-size: .9375rem; }
#auth-form { display: grid; gap: 12px; }
.auth__msg { font-size: .875rem; color: var(--black); min-height: 1.2em; }
.auth__submit { width: 100%; }
.auth__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.linkish { background: none; border: 0; padding: 4px 0; font-size: .875rem; color: var(--armor); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--black); }
.auth__back { font-size: .8125rem; color: var(--armor); text-decoration: none; }
.side__logo { color: var(--chalk); }
.side__logo .logo__word { color: var(--chalk); letter-spacing: .02em; font-family: var(--font-head); }
.side__logo .n51-mark rect { stroke: rgba(247,245,242,.25); stroke-width: 1; }
.side__user { font-size: .75rem; color: var(--on-black-muted); padding: 0 4px 6px; overflow-wrap: anywhere; }
.app { min-height: 100vh; }

/* Shared form fields (editor, settings, auth) */
.ed-field { display: grid; gap: 6px; font-size: .875rem; font-weight: 500; min-width: 0; }
.ed-field > span:first-child { color: var(--black); }
.ed-field input, .ed-field textarea, .ed-field select,
.rates input, .settings__add input, .d-book textarea {
  min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--haze); background: var(--chalk);
  font: inherit; font-weight: 400; color: var(--black); width: 100%;
}
.ed-field textarea { min-height: 64px; resize: vertical; line-height: 1.5; }
.ed-field input:focus, .ed-field textarea:focus, .ed-field select:focus, .rates input:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 3px rgba(18,18,18,.08); }
.ed-hint { font-size: .75rem; font-weight: 400; color: var(--armor); }

/* ---------- Website editor ---------- */
.editor { display: grid; gap: 12px; max-width: 900px; }
.ed-bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--chalk) 92%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line);
}
.ed-bar__status { margin-right: auto; font-size: .8125rem; color: var(--armor); }
.ed-bar__status.is-dirty { color: var(--black); font-weight: 600; }
.ed-bar__status.is-dirty::before { content: "● "; }
.ed-section { padding: 0; overflow: hidden; }
.ed-section summary { list-style: none; cursor: pointer; display: grid; gap: 2px; padding: 16px 18px; }
.ed-section summary::-webkit-details-marker { display: none; }
.ed-section summary span { font-family: var(--font-head); font-weight: 600; font-size: 1rem; }
.ed-section summary span::after { content: " +"; color: var(--armor); }
.ed-section[open] summary span::after { content: " −"; }
.ed-section summary small { font-size: .8125rem; color: var(--armor); }
.ed-section summary:hover { background: var(--chalk); }
.ed-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 4px 18px 20px; }
.ed-fields > .ed-list, .ed-fields > .ed-image, .ed-fields > label:has(textarea) { grid-column: 1 / -1; }
@media (max-width: 640px) { .ed-fields { grid-template-columns: minmax(0, 1fr); } }
.ed-field--color { grid-template-columns: auto 1fr; align-items: center; }
.ed-field--color > span { grid-column: 1 / -1; }
.ed-field--color input { width: 52px; height: 40px; padding: 2px; }
.ed-field--color code { font-family: var(--font-mono); font-size: .8125rem; color: var(--armor); }
.ed-image__row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.ed-image__preview { width: 120px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--haze-soft); display: grid; place-items: center; flex: none; border: 1px solid var(--line); }
.ed-image__preview img { width: 100%; height: 100%; object-fit: cover; }
.ed-image__preview.is-logo img { object-fit: contain; background: var(--black); }
.ed-image__preview span { font-size: .75rem; color: var(--armor); }
.ed-image__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ed-upload { cursor: pointer; }
.ed-status { font-size: .8125rem; color: var(--armor); }
.ed-list { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--chalk); border: 1px solid var(--line); }
.ed-list__head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: .875rem; }
.ed-item { display: grid; gap: 10px; padding: 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.ed-item__bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ed-item__btns { display: flex; gap: 6px; flex-wrap: wrap; }
.ed-item__btns .chip { min-height: 30px; padding: 0 10px; }
.ed-item__btns .chip:disabled { opacity: .35; cursor: default; transform: none; }
.ed-item__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.ed-item__fields > .ed-image, .ed-item__fields > label:has(textarea) { grid-column: 1 / -1; }
@media (max-width: 640px) { .ed-item__fields { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Settings, drawer extras ---------- */
.settings { display: grid; gap: 14px; max-width: 900px; }
.settings .card { display: grid; gap: 12px; }
.settings__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 4px; }
.settings__add { display: flex; gap: 8px; }
.settings__add input { flex: 1; }
.rates { display: grid; gap: 14px; justify-items: start; }
.rates > label, .rates__grid label { display: grid; gap: 6px; font-size: .875rem; font-weight: 500; width: 100%; }
.rates__grid { display: grid; grid-template-columns: minmax(120px, 1fr) 110px 110px; gap: 8px 10px; align-items: center; width: 100%; max-width: 520px; font-size: .875rem; }
.rates__grid--2 { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); max-width: none; align-items: end; }
.check { display: flex !important; align-items: center; gap: 8px; font-size: .875rem; color: var(--black) !important; }
.check input { width: 18px !important; height: 18px; min-height: 0; padding: 0; flex: none; accent-color: var(--black); }
.d-contact a { color: var(--black); font-family: var(--font-mono); }
.d-note { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .9rem; white-space: pre-wrap; }
.d-danger { margin-left: auto; color: var(--error); border-color: var(--error); }
.d-book input, .d-book select { width: 100%; }
.job { text-align: left; }
a.kpi { text-decoration: none; color: var(--black); }
a.kpi.kpi--dark { color: var(--chalk); }
