/* ---------------------------------------------------------------------------
   Eutaw Subcontractor Portal
   Brand navy is #012169, lifted from EIS css/v4.css (--v4-brand) so the portal
   reads as the same company. Amber is the accent, used only for the
   auto-detected / attention states.
   Mobile-first: subs fill this in on a phone, standing on a job site, often
   in gloves. Touch targets are 44px minimum and nothing depends on hover.
--------------------------------------------------------------------------- */

:root {
  --navy:        #012169;
  --navy-lift:   #0a3183;
  --navy-deep:   #011845;
  --accent:      #f0a202;
  --accent-soft: #fff4dc;

  --bg:          #eef2f7;
  --surface:     #ffffff;
  --surface-alt: #f7fafc;
  --border:      #e4e7eb;
  --border-firm: #d2d6dc;

  --text:   #1a202c;
  --muted:  #4a5568;
  --faint:  #6b7280;
  --dim:    #94a3b8;

  --ok:        #1a8b5b;
  --ok-bg:     #dcfce7;
  --ok-border: #86efac;
  --warn:        #b45309;
  --warn-bg:     #fef3c7;
  --warn-border: #fcd34d;
  --bad:        #b91c1c;
  --bad-bg:     #fee2e2;
  --bad-border: #fca5a5;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 2px rgba(1,33,105,.05), 0 4px 16px rgba(1,33,105,.07);
  --shadow-lg: 0 8px 34px rgba(1,33,105,.16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- top bar ------------------------------------------------------------- */

.sp-top {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 45%, var(--navy-lift) 100%);
  color: #fff;
  box-shadow: 0 2px 14px rgba(1,24,69,.28);
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
}

.sp-top-in {
  max-width: 940px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  margin-right: auto;
  min-width: 0;
}

.sp-mark {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -.02em;
  box-shadow: inset 0 -3px 0 var(--accent);
}

.sp-brand-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.sp-brand-txt b { font-size: 17px; letter-spacing: .01em; }
.sp-brand-txt small {
  font-size: 11.5px; opacity: .82; font-weight: 500;
  letter-spacing: .05em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sp-who { display: none; flex-direction: column; text-align: right; line-height: 1.25; min-width: 0; }
.sp-who-name { font-size: 13.5px; font-weight: 600; }
.sp-who-co   { font-size: 11.5px; opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sp-signout {
  color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 600;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  padding: 8px 15px;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.sp-signout:hover, .sp-signout:focus-visible { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.6); }

@media (min-width: 620px) { .sp-who { display: flex; } }

/* --- layout -------------------------------------------------------------- */

.sp-wrap { width: 100%; max-width: 940px; margin: 0 auto; padding: 20px 16px 40px; flex: 1 0 auto; }

.sp-page-head { margin: 4px 0 18px; }
.sp-page-head h1 { font-size: 23px; line-height: 1.25; margin: 0 0 4px; letter-spacing: -.015em; }
.sp-page-head p  { margin: 0; color: var(--faint); font-size: 14.5px; }

.sp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.sp-card > h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--faint); margin: 0 0 14px; font-weight: 700;
}
.sp-card-tight { padding: 0; overflow: hidden; }

/* --- job picker ---------------------------------------------------------- */

.sp-jobs { display: grid; gap: 12px; }
@media (min-width: 700px) { .sp-jobs { grid-template-columns: 1fr 1fr; } }

.sp-job {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: transform .14s ease, box-shadow .14s ease, border-left-color .14s ease;
}
.sp-job:hover, .sp-job:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-left-color: var(--accent);
}
.sp-job-body { min-width: 0; flex: 1; }
.sp-job-name { font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.sp-job-meta { font-size: 13px; color: var(--faint); margin-top: 3px; }
.sp-job-go   { color: var(--dim); font-size: 21px; line-height: 1; flex: 0 0 auto; }

/* --- weather hero -------------------------------------------------------- */

.sp-wx {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-lift) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.sp-wx-main { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }
.sp-wx-temp { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.sp-wx-cond { font-size: 15px; opacity: .92; }
.sp-wx-stats { display: flex; gap: 18px; font-size: 13px; }
.sp-wx-stat b { display: block; font-size: 15px; font-weight: 650; }
.sp-wx-stat span { opacity: .74; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.sp-wx-tag {
  background: rgba(240,162,2,.2);
  border: 1px solid rgba(240,162,2,.55);
  color: #ffd88a;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 4px 10px;
}
.sp-wx-none { background: var(--surface-alt); color: var(--muted); border: 1px dashed var(--border-firm); }

/* --- forms --------------------------------------------------------------- */

.sp-field { margin-bottom: 16px; }
.sp-field:last-child { margin-bottom: 0; }

.sp-label {
  display: block;
  font-size: 13px; font-weight: 650;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: .01em;
}
.sp-hint { font-weight: 400; color: var(--dim); font-size: 12.5px; }

.sp-input, .sp-select, .sp-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;                 /* 16px stops iOS zooming the page on focus */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-firm);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  min-height: 46px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.sp-textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.sp-input:focus, .sp-select:focus, .sp-textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(1,33,105,.13);
}
.sp-select { appearance: auto; }

.sp-row { display: grid; gap: 14px; }
@media (min-width: 560px) { .sp-row-2 { grid-template-columns: 1fr 1fr; } }

/* big number steppers, easy to hit with gloves on */
.sp-count { display: flex; align-items: stretch; gap: 0; max-width: 210px; }
.sp-count button {
  width: 52px; flex: 0 0 52px;
  border: 1px solid var(--border-firm);
  background: var(--surface-alt);
  color: var(--navy);
  font-size: 23px; font-weight: 600; line-height: 1;
  cursor: pointer;
  transition: background .12s ease;
}
.sp-count button:hover { background: #e8eef7; }
.sp-count button:active { background: #dbe4f2; }
.sp-count button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; }
.sp-count button:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }
.sp-count .sp-input { border-radius: 0; text-align: center; font-size: 19px; font-weight: 650; max-width: 106px; }

/* --- buttons ------------------------------------------------------------- */

.sp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  font-family: inherit; font-size: 15.5px; font-weight: 650;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 1px 2px rgba(1,33,105,.2);
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.sp-btn:hover { background: var(--navy-lift); box-shadow: 0 3px 12px rgba(1,33,105,.26); }
.sp-btn:active { transform: translateY(1px); }
.sp-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.sp-btn-ghost { background: var(--surface); color: var(--navy); border-color: var(--border-firm); box-shadow: none; }
.sp-btn-ghost:hover { background: var(--surface-alt); border-color: var(--navy); }
.sp-btn-danger { background: var(--surface); color: var(--bad); border-color: var(--bad-border); box-shadow: none; }
.sp-btn-danger:hover { background: var(--bad-bg); }
.sp-btn-wide { width: 100%; }
.sp-btn-lg { min-height: 54px; font-size: 16.5px; }

.sp-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sp-actions .sp-spacer { margin-left: auto; }

/* --- flashes and badges -------------------------------------------------- */

.sp-flash {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  margin-bottom: 16px;
  border: 1px solid;
}
.sp-flash-ok   { background: var(--ok-bg);   color: #166534; border-color: var(--ok-border); }
.sp-flash-warn { background: var(--warn-bg); color: #92400e; border-color: var(--warn-border); }
.sp-flash-bad  { background: var(--bad-bg);  color: #991b1b; border-color: var(--bad-border); }
.sp-flash-info { background: #dbeafe;        color: #1e3a8a; border-color: #93c5fd; }

.sp-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}
.sp-badge-ok      { background: var(--ok-bg);   color: #166534; }
.sp-badge-warn    { background: var(--warn-bg); color: #92400e; }
.sp-badge-void    { background: #eef2f5;        color: var(--faint); }
.sp-badge-review  { background: #dbeafe;        color: #1e3a8a; }

/* --- entry list ---------------------------------------------------------- */

.sp-list { list-style: none; margin: 0; padding: 0; }
.sp-list li { border-top: 1px solid var(--border); }
.sp-list li:first-child { border-top: none; }
.sp-entry {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px;
  text-decoration: none; color: inherit;
  transition: background .12s ease;
}
.sp-entry:hover { background: var(--surface-alt); }
.sp-entry-date { font-weight: 650; font-size: 15px; flex: 0 0 auto; min-width: 92px; }
.sp-entry-sum  { color: var(--faint); font-size: 13.5px; min-width: 0; flex: 1;
                 overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-entry-void .sp-entry-date, .sp-entry-void .sp-entry-sum { text-decoration: line-through; opacity: .6; }

/* --- documents ----------------------------------------------------------- */

.sp-drop {
  border: 2px dashed var(--border-firm);
  border-radius: var(--radius);
  background: var(--surface-alt);
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.sp-drop:hover, .sp-drop.is-over { border-color: var(--navy); background: #eef3fb; }
.sp-drop.is-over { border-style: solid; }
.sp-drop-icon { font-size: 27px; line-height: 1; margin-bottom: 8px; }
.sp-drop b { display: block; font-size: 15px; margin-bottom: 3px; }
.sp-drop span { color: var(--faint); font-size: 13px; }

.sp-docs { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 9px; }
.sp-doc {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  background: var(--surface);
  font-size: 14px;
}
.sp-doc-ext {
  flex: 0 0 auto;
  background: var(--navy); color: #fff;
  border-radius: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  padding: 5px 7px; text-transform: uppercase;
}
.sp-doc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
               color: var(--navy); text-decoration: none; font-weight: 550; }
.sp-doc-name:hover { text-decoration: underline; }
.sp-doc-size { color: var(--dim); font-size: 12.5px; flex: 0 0 auto; }
.sp-doc-rm {
  flex: 0 0 auto; width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--faint);
  font-size: 17px; line-height: 1; cursor: pointer;
}
.sp-doc-rm:hover { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-border); }

.sp-progress { height: 4px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 10px; display: none; }
.sp-progress.is-on { display: block; }
.sp-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }

/* --- login --------------------------------------------------------------- */

.sp-auth-body { background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 55%, var(--navy-lift) 100%); }
.sp-auth {
  width: 100%; max-width: 410px;
  margin: 0 auto; padding: 34px 18px 40px;
  flex: 1 0 auto;
  display: flex; flex-direction: column; justify-content: center;
}
.sp-auth-card {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(1,24,69,.36);
  padding: 28px 24px 26px;
}
.sp-auth-mark {
  width: 54px; height: 54px; margin: 0 auto 16px;
  display: grid; place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-lift) 100%);
  color: #fff; font-size: 27px; font-weight: 800;
  box-shadow: inset 0 -4px 0 var(--accent);
}
.sp-auth h1 { font-size: 20px; text-align: center; margin: 0 0 5px; letter-spacing: -.015em; }
.sp-auth-sub { text-align: center; color: var(--faint); font-size: 14px; margin: 0 0 22px; }
.sp-auth-foot { text-align: center; color: rgba(255,255,255,.62); font-size: 12.5px; margin-top: 20px; }

/* --- footer -------------------------------------------------------------- */

.sp-foot {
  flex: 0 0 auto;
  text-align: center;
  color: var(--dim);
  font-size: 12px;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
}
.sp-foot-note { color: var(--dim); }

.sp-empty { text-align: center; padding: 34px 18px; color: var(--faint); }
.sp-empty-icon { font-size: 31px; margin-bottom: 10px; opacity: .5; }

.sp-muted { color: var(--faint); font-size: 13.5px; }
.sp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .sp-job:hover { transform: none; }
}
