/* Two Broke Dudez — shared web styles
   Brand tokens mirror src/theme + branding.md. Used by /apply and the worker dashboard. */

:root {
  --brand: #007AC5;
  --brand-dark: #005C99;
  --brand-tint: #E6F2FB;
  --ink-900: #0E1B2A;
  --ink-700: #28384A;
  --ink-500: #5A6B7E;
  --ink-300: #A7B3C2;
  --surface-0: #FFFFFF;
  --surface-50: #F5F7FA;
  --surface-100: #EBEFF4;
  --success: #22A06B;
  --warning: #E08F18;
  --danger: #D64545;
  --radius-card: 16px;
  --radius-input: 12px;
  --shadow-card: 0 8px 28px rgba(14, 27, 42, 0.10);
  --shadow-soft: 0 2px 8px rgba(14, 27, 42, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--surface-50);
  color: var(--ink-700);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Aclonica', 'Montserrat', sans-serif;
  color: var(--ink-900);
  font-weight: 400;
  line-height: 1.25;
}

a { color: var(--brand); }

/* ---------- Layout ---------- */
.page { max-width: 560px; margin: 0 auto; padding: 0 16px 56px; }

.hero {
  background: var(--brand);
  color: #fff;
  text-align: center;
  padding: 32px 16px 28px;
}
.hero .logo {
  width: 84px; height: 84px;
  object-fit: contain;
  background: #fff;
  border-radius: 20px;
  padding: 8px;
  box-shadow: var(--shadow-soft);
}
.hero h1 { color: #fff; font-size: 30px; margin-top: 14px; }
.hero p { color: rgba(255, 255, 255, 0.92); margin-top: 6px; font-size: 15px; }

/* ---------- Card ---------- */
.card {
  background: var(--surface-0);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px 20px;
  margin-top: -20px;
}

/* ---------- Progress ---------- */
.progress { margin-bottom: 20px; }
.progress-label {
  font-size: 13px; font-weight: 600; color: var(--ink-500);
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em;
}
.progress-track {
  height: 8px; background: var(--surface-100);
  border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--brand);
  border-radius: 999px; transition: width 0.3s ease;
}

/* ---------- Steps ---------- */
.step { display: none; }
.step.active { display: block; }
.step h2 { font-size: 22px; margin-bottom: 4px; }
.step .step-sub { color: var(--ink-500); font-size: 14px; margin-bottom: 20px; }

/* ---------- Fields ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 14px; font-weight: 600;
  color: var(--ink-700); margin-bottom: 6px;
}
.field .hint { font-weight: 400; color: var(--ink-500); font-size: 13px; }

.control {
  width: 100%; min-height: 48px;
  padding: 12px 14px;
  font-family: inherit; font-size: 16px; color: var(--ink-900);
  background: var(--surface-50);
  border: 1.5px solid var(--surface-100);
  border-radius: var(--radius-input);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.control:focus {
  outline: none; border-color: var(--brand); background: #fff;
}
textarea.control { min-height: 92px; resize: vertical; }
select.control { appearance: none; background-image: none; }

.field.invalid .control { border-color: var(--danger); background: #FDF1F1; }
.field-error {
  display: none; color: var(--danger);
  font-size: 13px; font-weight: 600; margin-top: 6px;
}
.field.invalid .field-error { display: block; }

.row { display: flex; gap: 12px; }
.row .field { flex: 1; }

/* ---------- Choice chips (radio) ---------- */
.choice-group { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  flex: 1; min-width: 120px;
  position: relative;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: block; text-align: center;
  padding: 12px 10px; min-height: 48px;
  font-size: 15px; font-weight: 600; color: var(--ink-700);
  background: var(--surface-50);
  border: 1.5px solid var(--surface-100);
  border-radius: var(--radius-input);
  cursor: pointer; transition: all 0.15s ease;
}
.choice input:checked + span {
  background: var(--brand-tint);
  border-color: var(--brand);
  color: var(--brand-dark);
}

/* ---------- Photo upload tiles ---------- */
.photo-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.photo-tile {
  flex: 1; min-width: 140px;
  border: 1.5px dashed var(--ink-300);
  border-radius: var(--radius-input);
  background: var(--surface-50);
  min-height: 150px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 14px; cursor: pointer;
  transition: all 0.15s ease;
  overflow: hidden; position: relative;
}
.photo-tile:hover { border-color: var(--brand); background: var(--brand-tint); }
.photo-tile input { display: none; }
.photo-tile .tile-icon { font-size: 26px; }
.photo-tile .tile-label { font-size: 14px; font-weight: 600; color: var(--ink-700); margin-top: 6px; }
.photo-tile .tile-hint { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.photo-tile.has-photo { border-style: solid; border-color: var(--brand); padding: 0; }
.photo-tile img.preview {
  width: 100%; height: 150px; object-fit: cover; display: none;
}
.photo-tile.has-photo img.preview { display: block; }
.photo-tile.has-photo .tile-body { display: none; }
.photo-tile .change-badge {
  display: none; position: absolute; bottom: 8px; right: 8px;
  background: rgba(14, 27, 42, 0.78); color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px;
}
.photo-tile.has-photo .change-badge { display: block; }
.field.invalid .photo-tile { border-color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
  width: 100%; min-height: 52px;
  font-family: inherit; font-size: 16px; font-weight: 700;
  border: none; border-radius: 999px; cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: 0.55; cursor: default; }
.btn-secondary { background: var(--surface-100); color: var(--ink-700); }
.btn-secondary:hover { background: #DFE5EC; }
.btn-ghost { background: transparent; color: var(--brand); min-height: 44px; }

.btn-row { display: flex; gap: 12px; margin-top: 24px; }
.btn-row .btn { flex: 1; }

/* ---------- Banners ---------- */
.banner {
  border-radius: var(--radius-input);
  padding: 12px 14px; font-size: 14px; font-weight: 600;
  margin-bottom: 16px;
}
.banner-error { background: #FDF1F1; color: var(--danger); }
.banner-info { background: var(--brand-tint); color: var(--brand-dark); }

/* ---------- Spinner ---------- */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite; vertical-align: -3px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Success ---------- */
.success { display: none; text-align: center; padding: 8px 4px 4px; }
.success.active { display: block; }
.success .check {
  width: 72px; height: 72px; margin: 0 auto 16px;
  background: var(--success); color: #fff;
  border-radius: 50%; font-size: 38px;
  display: flex; align-items: center; justify-content: center;
}
.success h2 { font-size: 24px; margin-bottom: 8px; }
.success p { color: var(--ink-500); font-size: 15px; }

/* ---------- Footer ---------- */
.foot {
  text-align: center; color: var(--ink-500);
  font-size: 13px; margin-top: 20px;
}
.foot a { font-weight: 600; text-decoration: none; }

/* ============================================================
   Worker dashboard
   ============================================================ */

.app-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--brand);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
}
.app-header img {
  width: 34px; height: 34px;
  background: #fff; border-radius: 8px; padding: 3px;
  object-fit: contain;
}
.app-header .wordmark { font-family: 'Aclonica', sans-serif; color: #fff; font-size: 17px; }
.app-header .spacer { flex: 1; }
.app-header .greeting { color: rgba(255, 255, 255, 0.92); font-size: 13px; font-weight: 600; }

.tabbar {
  position: sticky; top: 58px; z-index: 19;
  display: flex; background: var(--surface-0);
  border-bottom: 1px solid var(--surface-100);
}
.tab {
  flex: 1; text-align: center; padding: 10px 4px 8px;
  font-size: 12px; font-weight: 600; color: var(--ink-500);
  background: none; border: none; cursor: pointer;
  border-bottom: 3px solid transparent;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab .tab-ico { display: block; font-size: 19px; margin-bottom: 3px; }

.app-body { max-width: 620px; margin: 0 auto; padding: 16px; }
.section { display: none; }
.section.active { display: block; }
.section h2 { font-size: 22px; margin-bottom: 14px; }
.section .sub-head {
  font-size: 13px; color: var(--ink-500); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; margin: 20px 0 10px;
}

/* List cards (jobs + offers) */
.list-card {
  background: var(--surface-0); border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft); padding: 16px; margin-bottom: 12px;
}
.list-card.tappable { cursor: pointer; }
.date-pill {
  display: inline-block; background: var(--brand-tint); color: var(--brand-dark);
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; margin-bottom: 8px;
}
.card-title { font-size: 17px; font-weight: 700; color: var(--ink-900); }
.card-meta { font-size: 14px; color: var(--ink-500); margin-top: 2px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-100); color: var(--ink-700);
}
.chip.role { background: var(--brand-tint); color: var(--brand-dark); }
.chip.warn { background: #FBEEDB; color: #9A6510; }
.chip.ok { background: #E4F4EC; color: #1A7D52; }

.detail { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--surface-100); display: none; }
.list-card.open .detail { display: block; }
.detail-row { font-size: 14px; margin-bottom: 9px; }
.detail-row:last-child { margin-bottom: 0; }
.detail-row .lbl { color: var(--ink-500); font-weight: 600; }
.detail-row a { color: var(--brand); font-weight: 600; text-decoration: none; }

.offer-actions { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.offer-actions .pick-label { font-size: 13px; font-weight: 600; color: var(--ink-500); }

/* Chat list */
.chat-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-0); border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft); padding: 13px 14px; margin-bottom: 10px;
  cursor: pointer; border: none; width: 100%; text-align: left;
  font-family: inherit;
}
.chat-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand-tint); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; flex-shrink: 0;
}
.chat-info { flex: 1; min-width: 0; }
.chat-info .ci-title { font-weight: 700; color: var(--ink-900); font-size: 15px; }
.chat-info .ci-preview {
  color: var(--ink-500); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-time { font-size: 12px; color: var(--ink-300); flex-shrink: 0; align-self: flex-start; }

/* Chat detail */
.chat-view { display: none; }
.chat-view.active { display: block; }
.chat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.chat-head .back-btn {
  background: none; border: none; font-size: 26px; line-height: 1;
  color: var(--brand); cursor: pointer; padding: 0 6px 0 0; width: auto; min-height: 0;
}
.chat-head .ch-title { font-weight: 700; font-size: 17px; color: var(--ink-900); }
.msg-list { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 14px; }
.bubble { max-width: 80%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; }
.bubble.them { background: var(--surface-0); box-shadow: var(--shadow-soft); align-self: flex-start; border-bottom-left-radius: 5px; }
.bubble.me { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; }
.bubble .sender { font-size: 12px; font-weight: 700; color: var(--brand-dark); margin-bottom: 3px; }
.bubble .b-time { font-size: 11px; opacity: 0.65; margin-top: 4px; }
.bubble img { max-width: 100%; border-radius: 10px; margin-top: 4px; display: block; }
.bubble a { color: inherit; }
.sys-msg {
  align-self: center; background: var(--surface-100); color: var(--ink-500);
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  max-width: 92%; text-align: center;
}
.offer-msg {
  align-self: stretch; background: var(--brand-tint);
  border: 1px solid var(--brand); border-radius: 12px; padding: 12px;
}
.offer-msg .om-head {
  font-size: 11px; font-weight: 700; color: var(--brand-dark);
  letter-spacing: 0.06em; margin-bottom: 4px;
}
.offer-msg .om-body { font-size: 14px; color: var(--ink-700); }
.composer {
  display: flex; gap: 8px; position: sticky; bottom: 0;
  background: var(--surface-50); padding: 10px 0;
}
.composer .control { flex: 1; }
.composer .btn { width: auto; padding: 0 22px; min-height: 48px; }

/* Profile */
.profile-head { text-align: center; margin-bottom: 22px; }
.big-avatar {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 10px;
  background: var(--brand-tint); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700;
}
.profile-head .pname { font-size: 22px; font-family: 'Aclonica', sans-serif; color: var(--ink-900); }

/* Empty + states */
.empty { text-align: center; color: var(--ink-500); padding: 44px 20px; }
.empty .e-ico { font-size: 36px; }
.empty p { margin-top: 8px; font-size: 14px; }

.gate { text-align: center; padding: 22px 6px; }
.gate .g-ico {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; background: var(--brand-tint);
}
.gate h2 { font-size: 22px; margin-bottom: 8px; }
.gate p { color: var(--ink-500); font-size: 15px; margin-bottom: 20px; }

.loading { text-align: center; padding: 64px 20px; color: var(--ink-500); }
.spinner-blue {
  display: inline-block; width: 28px; height: 28px;
  border: 3px solid var(--surface-100); border-top-color: var(--brand);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}

/* Danger button */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B83B3B; }
.btn-danger:disabled { opacity: 0.55; cursor: default; }

/* Modal overlay */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(14, 27, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
.modal-card {
  background: var(--surface-0);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px; max-width: 400px; width: 100%;
}
.modal-card h3 {
  font-family: 'Aclonica', sans-serif; font-size: 20px;
  margin-bottom: 8px; color: var(--ink-900); font-weight: 400;
}
.modal-card p { font-size: 14px; color: var(--ink-700); margin-bottom: 12px; }

/* Avatar image in profile */
.big-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
