/* Shared portal tokens — type matches techcomllc.net / blocks (Albert Sans) */
@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/albert-sans/AlbertSans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/albert-sans/AlbertSans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-family-base: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font: var(--font-family-base);
  --accent: #ff5a00;
  --accent-hover: #ff5000;
  --accent-soft: rgba(255, 90, 0, 0.08);
  --accent-border: rgba(255, 90, 0, 0.22);
  --blue: #ff5a00;
  --blue-soft: rgba(255, 90, 0, 0.07);
  --blue-border: rgba(255, 90, 0, 0.2);
  --blue-icon: rgba(255, 90, 0, 0.1);
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface2: #f2f2f2;
  --text: #111111;
  --text-primary: #111111;
  --muted: rgba(17, 17, 17, 0.55);
  --text-muted: rgba(17, 17, 17, 0.55);
  --border: rgba(17, 17, 17, 0.1);
  --border-hover: rgba(17, 17, 17, 0.2);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --panel-dark: #262626;
  --scrollbar-thumb: rgba(255, 90, 0, 0.35);
  --scrollbar-thumb-hover: rgba(255, 90, 0, 0.55);
  /* Single source of truth for notches / home indicators (iOS + Android). */
  --safe-top: 0px;
  --safe-right: 0px;
  --safe-bottom: 0px;
  --safe-left: 0px;
  --safe-top: constant(safe-area-inset-top);
  --safe-right: constant(safe-area-inset-right);
  --safe-bottom: constant(safe-area-inset-bottom);
  --safe-left: constant(safe-area-inset-left);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Shared portal scrollbar. Keep these declarations authoritative so every
   page and nested scrolling region uses the same OSP Reports treatment. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent !important;
}

*::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent !important;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb) !important;
  border-radius: 999px !important;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover) !important;
}

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

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  /* Bottom inset lives on .shell so it is not double-applied. */
  padding-bottom: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

.shell {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  /* Base gap + safe inset once — avoids status-bar + fixed padding double space. */
  --shell-pad-top: calc(12px + var(--safe-top));
  --shell-pad-x: max(16px, var(--safe-left));
  --shell-pad-right: max(16px, var(--safe-right));
  padding-top: var(--shell-pad-top);
  padding-right: var(--shell-pad-right);
  padding-bottom: calc(32px + var(--safe-bottom));
  padding-left: var(--shell-pad-x);
}

/* Flash sits above shell and already clears the notch — don't pad shell twice. */
body:has(> .flash-stack) .shell {
  --shell-pad-top: 12px;
  padding-top: var(--shell-pad-top);
}

.flash-stack {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(12px + var(--safe-top)) max(16px, var(--safe-right)) 0 max(16px, var(--safe-left));
}

.flash-msg {
  margin-bottom: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
}

.flash-msg--danger {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.35);
  color: #7f1d1d;
}

.flash-msg--info {
  background: rgba(255, 90, 0, 0.08);
  border-color: rgba(255, 90, 0, 0.28);
  color: #9a3a00;
}

.header {
  margin-bottom: 20px;
}

.header--row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.title {
  font-size: clamp(1.5rem, 5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 12px 36px rgba(17, 17, 17, 0.06);
  margin-bottom: 16px;
}

.card--center {
  text-align: center;
}

.lead {
  margin-bottom: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.section-title {
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 49px;
  padding: 0 26px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: var(--panel-dark);
  color: #fff;
  border-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
  }

  .btn-secondary:hover {
    background: #1a1a1a;
    color: #fff;
  }
}

.profile-card {
  padding: 16px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-meta {
  min-width: 0;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  flex: 0 0 auto;
}

.avatar--placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ff5a00 0%, #ff7a33 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
}

.profile-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.profile-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.profile-link:hover {
  text-decoration: underline;
}

.health-output {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f8f9fb;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  overflow-x: auto;
}

.setup-card .section-title {
  margin-bottom: 10px;
}

.setup-uri {
  user-select: all;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
}

@media (min-width: 560px) {
  .header--row {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .header--row form {
    flex-shrink: 0;
  }
}

.access-denied-banner {
  margin: 0 0 18px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.06);
  text-align: center;
}

.access-denied-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: #991b1b;
}

.access-denied-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.is-access-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.form-feedback-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(192, 57, 43, 0.28);
  background: rgba(192, 57, 43, 0.08);
  color: #8b1a0f;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.locates-submit,
.locates-submit-btn,
.reimb-submit-btn,
.v-btn-primary,
.v-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Shared primary CTA shape — match site/auth pill buttons */
.locates-submit,
.locates-submit-btn,
.reimb-submit-btn,
.v-btn-primary,
.mi-btn-primary {
  min-height: 49px;
  border-radius: var(--radius-pill) !important;
  font-weight: 500;
}

.login-monday-spinner {
  width: 28px;
  height: 28px;
  margin: 16px auto 0;
  border: 3px solid rgba(17, 17, 17, 0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: login-monday-spin 0.8s linear infinite;
}

@keyframes login-monday-spin {
  to {
    transform: rotate(360deg);
  }
}

.v2-field-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted, rgba(17, 17, 17, 0.55));
  min-height: 16px;
}

.v2-field-hint--error {
  color: #b42318;
}

.v2-load-retry {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent, #ff5a00);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.v2-load-retry:hover {
  color: #cc4800;
}
