/* FinPros HVAC Contractor Portal
   Mobile-only MVP · portal.finproshvac.com
   Navy #0B1F3A · cyan #00B4D8 */

:root {
  --navy: #0B1F3A;
  --navy-mid: #12325A;
  --cyan: #00B4D8;
  --cyan-bright: #22D3EE;
  --cyan-soft: #E0F7FC;
  --field-green: #1B7A4E;
  --amber: #E8A317;
  --danger: #C0392B;
  --ink: #0F172A;
  --muted: #64748B;
  --line: #E2E8F0;
  --bg: #E8EEF5;
  --card: #FFFFFF;
  --radius: 14px;
  --tap: 48px;
  --shadow: 0 2px 10px rgba(11, 31, 58, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.example-banner {
  background: #FEF3C7;
  color: #92400E;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 0.4rem 0.75rem;
  text-transform: uppercase;
}

/* Phone frame for deck embeds */
.phone-frame {
  width: 390px;
  max-width: 100%;
  margin: 0 auto;
  background: var(--bg);
  border: 3px solid var(--navy);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 720px;
}

.phone-chrome {
  background: var(--navy);
  color: #fff;
  padding: 0.55rem 1rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.phone-chrome .brand {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.phone-chrome .brand span { color: var(--cyan-bright); }
.phone-chrome .meta { font-size: 0.7rem; opacity: 0.75; }

.app-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: #fff;
  padding: 1rem 1rem 1.1rem;
}
.app-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}
.app-header .sub {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  opacity: 0.85;
}
.app-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.app-header .back-row { margin: 0.35rem 0 0; }
.app-header .back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.15rem 0;
  color: var(--cyan-bright);
  font-weight: 700;
  text-decoration: none;
}

.tab-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.tab-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  gap: 0.15rem;
  border-bottom: 3px solid transparent;
}
.tab-bar a.active {
  color: var(--navy);
  border-bottom-color: var(--cyan);
}
.tab-bar .ico { font-size: 1.1rem; line-height: 1; }

.page { padding: 1rem; padding-bottom: 5.5rem; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 0.85rem;
  border: 1px solid var(--line);
}
.card h2, .card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.status-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}
.status-pill.awaiting-you { background: #FEF3C7; color: #92400E; }
.status-pill.awaiting-office { background: var(--cyan-soft); color: #0E7490; }
.status-pill.in-progress { background: #DBEAFE; color: #1E40AF; }
.status-pill.ready { background: #D1FAE5; color: #065F46; }
.status-pill.blocked { background: #FEE2E2; color: #991B1B; }

.job-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s;
}
.job-card:hover { border-color: var(--cyan); text-decoration: none; }
.job-card .top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.job-card .addr { font-weight: 700; font-size: 1.02rem; }
.job-card .meta-row {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.4rem;
}
.job-card .action-hint {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy-mid);
  background: var(--cyan-soft);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0 1.15rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  gap: 0.4rem;
  width: 100%;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--cyan);
  color: var(--navy);
}
.btn-primary:hover { background: var(--cyan-bright); }
.btn-navy {
  background: var(--navy);
  color: #fff;
}
.btn-navy:hover { background: var(--navy-mid); }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--line);
}
.btn-row {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.fab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  z-index: 20;
  max-width: 390px;
  margin: 0 auto;
}
/* When page is full-bleed phone mock not in frame */
body.mobile-app .fab-bar { max-width: 100%; }

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1.1rem 0 0.5rem;
}

.filter-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
}
.chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.filter-chips a.chip { text-decoration: none; display: inline-flex; align-items: center; }
.chip.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}
.msg .bubble {
  max-width: 88%;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  font-size: 0.9rem;
}
.msg.office .bubble {
  background: var(--cyan-soft);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg.you .bubble {
  background: var(--navy);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg .who {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
}
.msg.you .who { align-self: flex-end; }

.doc-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
.doc-row:last-child { border-bottom: none; }
.doc-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--cyan-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.doc-meta { flex: 1; min-width: 0; }
.doc-meta .name { font-weight: 600; font-size: 0.9rem; }
.doc-meta .sub { font-size: 0.72rem; color: var(--muted); }

.loe-box {
  border: 2px dashed var(--cyan);
  background: linear-gradient(180deg, #F0FBFE 0%, #fff 100%);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0.75rem 0;
}
.loe-box h3 {
  margin: 0 0 0.35rem;
  color: var(--navy);
  font-size: 0.95rem;
}
.loe-box p {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.checklist { list-style: none; padding: 0; margin: 0 0 0.75rem; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  padding: 0.35rem 0;
}
.checklist .box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--cyan);
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 1px;
  background: #fff;
}
.checklist .box.done {
  background: var(--field-green);
  border-color: var(--field-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.dir-links {
  display: grid;
  gap: 0.5rem;
}
.dir-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap);
  padding: 0.65rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.dir-link:hover { border-color: var(--cyan); text-decoration: none; }
.dir-link .tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

/* Auth / public pages */
.auth-shell {
  flex: 1 0 auto;
  background: linear-gradient(160deg, var(--navy) 0%, #0A4A6E 55%, #087990 100%);
  padding: 0.35rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 20px;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  margin-top: 1rem;
}
.auth-logo {
  text-align: center;
  color: #fff;
  margin-top: 0.35rem;
  width: 100%;
  max-width: 400px;
}
.auth-logo .mark {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.auth-logo .mark span { color: var(--cyan-bright); }
.auth-logo .tagline {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 0.35rem;
}
.form-group { margin-bottom: 0.9rem; }
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  min-height: var(--tap);
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--cyan);
}
.hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}
.passkey-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem;
  background: var(--cyan-soft);
  border-radius: 12px;
  margin: 1rem 0;
}
.passkey-opt input { width: 22px; height: 22px; margin-top: 2px; flex-shrink: 0; }
.passkey-opt .txt { font-size: 0.85rem; }
.passkey-opt .txt strong { display: block; margin-bottom: 0.15rem; }

.public-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  padding: 0.15rem 1rem 0.65rem;
  background: var(--navy);
  color: #fff;
}
.public-nav .nav-aside {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}
.public-nav a.nav-aside:hover { text-decoration: underline; }

/* House lockup, centered at the top of every page from the shared head.
   The PNG is transparent where the brand plate is black.
   Name and tagline are in the image; do not repeat them as text. */
.fp-brand-top {
  background: var(--navy);
  display: flex;
  justify-content: center;
  padding: 0.75rem 1rem 0.45rem;
}
.fp-brand-plate {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
  width: min(100%, 280px);
  padding: 0.2rem 0.35rem 0.15rem;
}
.fp-brand-plate img {
  display: block;
  width: 100%;
  height: auto;
}
.hero-pub {
  background: linear-gradient(135deg, var(--navy) 0%, #0E5A7A 100%);
  color: #fff;
  padding: 2rem 1.25rem 2.5rem;
  text-align: center;
}
.hero-pub h1 {
  margin: 0 0 0.65rem;
  font-size: 1.55rem;
  line-height: 1.25;
}
.hero-pub p {
  margin: 0 auto 1.25rem;
  max-width: 28rem;
  opacity: 0.9;
  font-size: 0.95rem;
}
.note-box {
  background: #FEF3C7;
  border-left: 4px solid var(--amber);
  padding: 0.75rem 0.9rem;
  border-radius: 0 10px 10px 0;
  font-size: 0.82rem;
  color: #78350F;
  margin: 1rem 0;
}

/* Deck (index) */
.deck {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
.deck h1 { color: var(--navy); margin-top: 0; }
.deck .lock-list {
  background: var(--cyan-soft);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  font-size: 0.9rem;
}
.deck .lock-list li { margin-bottom: 0.35rem; }
.screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.screen-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.screen-tile h3 { margin: 0 0 0.35rem; color: var(--navy); font-size: 1rem; }
.screen-tile p { margin: 0 0 0.75rem; font-size: 0.85rem; color: var(--muted); }
.screen-tile iframe {
  width: 100%;
  height: 520px;
  border: 2px solid var(--navy);
  border-radius: 16px;
  background: #fff;
}
.approval-box {
  background: var(--card);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 2rem;
}
.approval-box h2 { margin-top: 0; color: var(--navy); }
.approval-box textarea {
  width: 100%;
  min-height: 100px;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.95rem;
}
.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}
.approval-actions .btn { width: auto; min-width: 140px; }
.mobile-only-badge {
  display: inline-block;
  background: var(--navy);
  color: var(--cyan-bright);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

@media (max-width: 420px) {
  .phone-frame { border-radius: 0; border-left: none; border-right: none; }
}

/* Production shell: one phone column. No desktop contractor layout. */
body.mobile-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
}
body.mobile-app .fab-bar { max-width: 480px; }
.header-tools {
  text-align: right;
  font-size: 0.75rem;
  opacity: 0.85;
}
.header-tools a { color: var(--cyan-bright); }
.header-tools form { display: inline; }
.header-tools button,
.header-tools a {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}
.header-tools button {
  background: none;
  border: none;
  color: var(--cyan-bright);
  font: inherit;
  font-weight: 700;
  padding: 0.35rem 0.1rem;
  cursor: pointer;
}
.flash {
  margin: 0.75rem 1rem 0;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
}
.flash-error { background: #FEE2E2; color: #991B1B; }
.flash-success { background: #D1FAE5; color: #065F46; }
.empty-state {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.step-done { color: var(--field-green); font-weight: 600; }
.step-current { font-weight: 700; color: var(--amber); }
.step-pending { color: var(--muted); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}