/* Shania Shareholders Portal - mobile-first. Palette and type follow the Shania sandbox
   (#212529 ink, #fd7e14 orange accent, #f8f9fa page, Segoe UI stack). */
:root {
  --ink: #212529;
  --ink-soft: #343a40;
  --muted: #5c636a;
  --orange: #fd7e14;
  --orange-deep: #a94f08;
  --orange-tint: #fff3e6;
  --page: #f8f9fa;
  --card: #ffffff;
  --line: #e2e5e8;
  --ok: #146c43;
  --ok-bg: #d1e7dd;
  --err: #b02a37;
  --err-bg: #f8d7da;
  --info: #055160;
  --info-bg: #cff4fc;
  --radius: .75rem;
  --shadow: 0 2px 10px rgba(33, 37, 41, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font: 1rem/1.5 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; height: auto; }
a { color: var(--orange-deep); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.break { overflow-wrap: anywhere; }

:focus-visible { outline: 3px solid var(--orange-deep); outline-offset: 2px; }

.skip-link {
  position: absolute; left: .5rem; top: -4rem; z-index: 20;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: .5rem;
}
.skip-link:focus { top: .5rem; }

/* ---------- Header ---------- */
.app-header {
  background: var(--card);
  border-bottom: 3px solid var(--orange);
  padding-top: env(safe-area-inset-top);
  position: sticky; top: 0; z-index: 10;
}
.app-header__inner {
  max-width: 60rem; margin: 0 auto; min-height: 3.5rem;
  padding: .4rem .75rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.brand {
  flex: 1 1 0;
  display: flex; align-items: center; gap: .5rem; min-width: 0;
  color: var(--ink); text-decoration: none; font-weight: 700;
}
.brand img { flex: none; height: 30px; width: auto; }
.brand__text { font-size: .85rem; line-height: 1.15; }
.brand img { height: 26px; }
.app-header__user { display: flex; align-items: center; gap: .25rem; min-width: 0; }
.user-name {
  flex: 0 0 auto; max-width: 32vw; font-size: .875rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-name__full { display: none; }
.signout { margin: 0; flex: none; }
.signout .btn { white-space: nowrap; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 60rem; margin: 0 auto; padding: 1.25rem 1rem 2rem; flex: 1 0 auto; }
.container--narrow { max-width: 28rem; }
body.plain .container { display: flex; flex-direction: column; justify-content: center; }
.app-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }

.page-title { font-size: 1.5rem; line-height: 1.25; margin: .25rem 0 1rem; }
.back-link {
  display: inline-flex; align-items: center; gap: .15rem; min-height: 2.75rem;
  color: var(--orange-deep); text-decoration: none; font-weight: 600;
}
.back-link:hover { text-decoration: underline; }
.icon { width: 1.5rem; height: 1.5rem; flex: none; }
.back-link .icon { width: 1.15rem; height: 1.15rem; }
.icon--lg { width: 2rem; height: 2rem; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__title { font-size: 1.1rem; margin-bottom: 1rem; }
.form-card { padding: 1.25rem 1rem; margin-bottom: 1rem; }
.pending { border-color: var(--orange); background: var(--orange-tint); }
.pending p + p, .pending p + button { margin-top: .5rem; }
.pending .btn { margin-top: 1rem; }

/* ---------- Dashboard ---------- */
.welcome { margin: .5rem 0 1.25rem; }
.welcome h1 { font-size: 1.6rem; line-height: 1.2; overflow-wrap: anywhere; }
.tile-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: 1fr; }
.tile {
  display: flex; align-items: center; gap: 1rem; min-height: 5.5rem; padding: 1rem;
  background: var(--card); color: var(--ink); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.tile__icon {
  flex: none; width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--orange-tint); color: var(--orange-deep);
}
.tile__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tile__title { font-size: 1.1rem; font-weight: 700; }
.tile__blurb { font-size: .875rem; color: var(--muted); }
.tile__chev { color: var(--muted); }
.tile:hover { border-color: var(--orange); box-shadow: 0 6px 18px rgba(33, 37, 41, .12); transform: translateY(-1px); }
.tile:hover .tile__chev { color: var(--orange-deep); }
.tile:active { transform: translateY(0) scale(.99); background: var(--orange-tint); }

/* ---------- Empty states ---------- */
.empty-state { padding: 2.5rem 1.25rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.empty-state__icon {
  width: 4rem; height: 4rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--orange-tint); color: var(--orange-deep); margin-bottom: .25rem;
}
.empty-state__title { font-size: 1.2rem; }
.empty-state p { max-width: 26rem; }
.empty-state__code { font-size: 3rem; font-weight: 700; color: var(--orange-deep); line-height: 1; }
.empty-state .btn { margin-top: .75rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: .55rem 1.1rem; border-radius: .5rem;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.btn-primary:active { background: var(--orange-deep); border-color: var(--orange-deep); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: #fff; }
.btn-quiet { background: transparent; color: var(--ink); padding-left: .6rem; padding-right: .6rem; }
.btn-quiet:hover { background: var(--orange-tint); color: var(--orange-deep); }
.btn-block { display: flex; width: 100%; margin-top: .5rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; min-width: 0; }
.field-row { display: grid; gap: 0; grid-template-columns: 1fr; }
label, legend { display: block; font-weight: 600; margin-bottom: .3rem; padding: 0; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], textarea {
  width: 100%; min-height: 2.9rem; padding: .6rem .75rem;
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #adb5bd; border-radius: .5rem; appearance: none; -webkit-appearance: none;
}
input[type=date] { min-width: 0; }
textarea { resize: vertical; min-height: 5.5rem; }
input:focus, textarea:focus { outline: 3px solid var(--orange-deep); outline-offset: 0; border-color: var(--ink); }
[aria-invalid=true] { border-color: var(--err); }
.field__hint { font-size: .85rem; color: var(--muted); margin-top: .35rem; }
.field__error { font-size: .875rem; color: var(--err); font-weight: 600; margin-top: .35rem; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 4.5rem; }
.password-toggle { position: absolute; right: .15rem; top: 50%; transform: translateY(-50%); min-height: 2.5rem; }
.password-toggle[hidden] { display: none; }

.pref { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.segmented { display: inline-flex; margin-top: .5rem; border: 1px solid var(--ink); border-radius: .5rem; overflow: hidden; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label {
  margin: 0; min-width: 5rem; min-height: 2.75rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-weight: 600; background: #fff; color: var(--ink);
}
.segmented input:checked + label { background: var(--ink); color: #fff; }
.segmented input:focus-visible + label { outline: 3px solid var(--orange-deep); outline-offset: -3px; }

/* ---------- Alerts / badges ---------- */
.alert { padding: .75rem 1rem; border-radius: .5rem; margin-bottom: 1rem; font-size: .95rem; }
.alert-success { background: var(--ok-bg); color: #0a3622; }
.alert-error { background: var(--err-bg); color: #58151c; }
.alert-info { background: var(--info-bg); color: #032830; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-ok { background: var(--ok-bg); color: #0a3622; }
.badge-muted { background: #e9ecef; color: #343a40; }

/* ---------- Login ---------- */
.auth-card { padding: 1.75rem 1.25rem; text-align: center; }
.auth-card form { text-align: left; margin-top: 1.25rem; }
.auth-card__logo { display: block; margin: 0 auto .75rem; height: auto; }
.auth-card__title { font-size: 1.4rem; }
.auth-card .alert { margin-top: 1rem; text-align: left; }
.auth-card__help { margin-top: 1.25rem; }

/* ---------- Larger screens ---------- */
@media (min-width: 400px) {
  .brand__text { font-size: .95rem; }
  .brand img { height: 30px; }
  .user-name__first { display: none; }
  .user-name__full { display: inline; }
}
@media (min-width: 40rem) {
  .container { padding: 2rem 1.5rem 3rem; }
  .app-header__inner { padding: .4rem 1.5rem; }
  .brand__text { font-size: 1.1rem; }
  .brand img { height: 36px; }
  .user-name { max-width: 20rem; font-size: .95rem; }
  .tile-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .tile { min-height: 7.5rem; padding: 1.25rem; }
  .form-card { padding: 1.5rem; max-width: 40rem; }
  .field-row { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .auth-card { padding: 2.25rem 2rem; }
  .page-title { font-size: 1.75rem; }
}

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