/* Blue Aruba — owner registration portal */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap');

:root {
  --ink: #0B2F4E;        /* deep sea */
  --ink-soft: #456381;
  --line: #D5E1EA;
  --sand: #F2F7FA;       /* page */
  --paper: #FFFFFF;
  --sea: #19ABE3;        /* Blue Aruba logo blue */
  --sea-deep: #0F8CBF;
  --shallows: #A6DFF3;
  --shallows-tint: #E6F6FC;
  --seagrass: #2E8B6E;
  --seagrass-tint: #E3F3EC;
  --coral: #C8483B;
  --coral-tint: #FBE9E6;
  --radius: 10px;
  --font: 'Figtree', system-ui, -apple-system, Segoe UI, 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.55;
  color: var(--ink);
  background: var(--sand);
}
a { color: var(--sea-deep); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }

/* The horizon: sea to sand. The one decorative element on every page. */
.horizon {
  height: 10px;
  background: linear-gradient(90deg, var(--ink) 0%, var(--sea) 45%, var(--shallows) 78%, #FFFFFF 100%);
}

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 24px; max-width: 1080px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { height: 40px; width: auto; display: block; }
.brand-divider { width: 1px; height: 28px; background: var(--line); }
.brand-name { font-weight: 700; font-size: 17px; }
.brand-sub { display: block; font-weight: 500; font-size: 13px; color: var(--ink-soft); }

.container { max-width: 1080px; margin: 0 auto; padding: 8px 24px 64px; }

/* Buttons */
.btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: var(--radius);
  padding: 12px 20px; border: 1px solid transparent; transition: background .15s, border-color .15s;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-height: 46px;
}
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--shallows); outline-offset: 2px;
}
.btn-primary { background: var(--sea); color: #fff; }
.btn-primary:hover { background: var(--sea-deep); }
.btn-primary:disabled { background: #A9D3E8; cursor: not-allowed; }
.btn-quiet { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--ink-soft); }
.btn-text { background: none; color: var(--sea-deep); padding: 6px 8px; min-height: 0; }
.btn-danger-text { background: none; color: var(--coral); padding: 6px 8px; min-height: 0; }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: 14px; }

/* Forms */
label { display: block; font-weight: 600; margin-bottom: 6px; }
.help { color: var(--ink-soft); font-size: 14px; margin: -2px 0 8px; }
input, select, textarea {
  font: inherit; width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--sea); }
textarea { min-height: 88px; resize: vertical; }
.field { margin-bottom: 18px; }
.field.changed input, .field.changed textarea, .field.changed select { border-color: var(--seagrass); background: #F7FCF9; }
.req::after { content: " *"; color: var(--coral); }
.na-opt { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; color: var(--ink-soft); margin-top: 8px; cursor: pointer; }
.na-opt input { width: 18px; height: 18px; margin: 0; accent-color: var(--sea); }
input.na { color: var(--ink-soft); background: #F4F7FA; }

.alert { padding: 12px 14px; border-radius: 8px; margin: 0 0 16px; font-size: 15px; }
.alert-error { background: var(--coral-tint); color: #7A2A22; border-left: 4px solid var(--coral); }
.alert-ok { background: var(--seagrass-tint); color: #1F5C48; border-left: 4px solid var(--seagrass); }
.alert-info { background: var(--shallows-tint); color: #184B63; border-left: 4px solid var(--sea); }

/* Panels */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.panel + .panel { margin-top: 20px; }

/* ---------- Login page ---------- */
.login-wrap { min-height: calc(100vh - 10px); display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: var(--ink); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side h1 { font-size: 40px; color: #fff; max-width: 14ch; margin-top: 24px; }
.login-side p { color: #BFD3E3; max-width: 44ch; font-size: 17px; }
.login-side .brand img { height: 64px; }
.login-side .brand, .login-side .brand-name { color: #fff; }
.login-side .brand-sub { color: #9FC0D8; }
.login-steps { list-style: none; padding: 0; margin: 28px 0 0; counter-reset: s; }
.login-steps li { counter-increment: s; display: flex; gap: 14px; align-items: baseline; margin-bottom: 14px; color: #DCE8F1; font-size: 16px; }
.login-steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--sea); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; transform: translateY(4px); }
.login-foot { font-size: 14px; color: #9FC0D8; }
.login-foot a { color: #DCE8F1; }
.login-main { display: grid; place-items: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 420px; }
.login-card h2 { font-size: 26px; }
.access-code { font-variant-numeric: tabular-nums; letter-spacing: .08em; text-transform: uppercase; }

@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 32px 24px; }
  .login-side h1 { font-size: 30px; }
  .login-main { padding: 32px 20px 56px; align-items: start; }
}

/* ---------- Portal layout ---------- */
.portal { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; margin-top: 12px; }
.rail { position: sticky; top: 20px; }
.rail-owner { padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; }
.rail-owner strong { display: block; font-size: 16px; }
.unit-list { margin: 6px 0 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: 14px; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: st; }
.steps li { counter-increment: st; }
.steps button {
  all: unset; display: flex; gap: 12px; align-items: center; width: 100%; padding: 11px 12px; border-radius: 10px; cursor: pointer; color: var(--ink-soft); font-weight: 500;
}
.steps button::before {
  content: counter(st); flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink-soft); background: var(--paper);
}
.steps li.active button { background: var(--paper); color: var(--ink); font-weight: 600; }
.steps li.active button::before { border-color: var(--sea); color: var(--sea); }
.steps li.done button::before { content: "✓"; background: var(--seagrass); border-color: var(--seagrass); color: #fff; }
.steps button:focus-visible { outline: 3px solid var(--shallows); }
.step-pane[hidden] { display: none; }

.pane-head { margin-bottom: 20px; }
.pane-head p { color: var(--ink-soft); max-width: 60ch; }

.instructions ol { padding-left: 20px; }
.poa-box { border: 1px solid var(--shallows); background: var(--shallows-tint); border-radius: 12px; padding: 18px 20px; margin: 4px 0 22px; }
.poa-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.poa-head h3 { margin: 0 0 2px; }
.poa-steps { margin: 0; padding-left: 20px; }
.poa-steps li { margin-bottom: 6px; }
.instructions li { margin-bottom: 10px; }
.doc-list { margin: 0; padding: 0; list-style: none; }
.doc-list li { padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; }
.doc-list li:last-child { border-bottom: 1px solid var(--line); }
.doc-list .tag { flex: none; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; height: fit-content; margin-top: 3px; }
.tag-req { background: var(--shallows-tint); color: #184B63; }
.tag-opt { background: #E8EEF3; color: var(--ink-soft); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 24px; }

/* Upload blocks */
.upload-block { padding: 20px 0; border-top: 1px solid var(--line); }
.upload-block:last-of-type { border-bottom: 1px solid var(--line); }
.upload-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.upload-head h3 { margin-bottom: 2px; }
.drop {
  margin-top: 12px; border: 1.5px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center; color: var(--ink-soft); background: #F7FBFD; cursor: pointer;
}
.drop.over { border-color: var(--sea); background: var(--shallows-tint); }
.drop input { display: none; }
.files { list-style: none; margin: 10px 0 0; padding: 0; }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--sand); border-radius: 8px; margin-top: 6px; font-size: 14px; }
.files .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .fsize { color: var(--ink-soft); flex: none; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--sea); width: 0; transition: width .2s; }

.coowner-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 14px; background: #FBFDFE; }
.coowner-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.coowner-head h3 { margin: 0; }
.person-slot { margin-top: 12px; }
.person-name { font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.person-slot + .person-slot { border-top: 1px dashed var(--line); padding-top: 12px; }

/* Review */
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.review-grid dt { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.review-grid dd { margin: 0 0 8px; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.check-list li:last-child { border-bottom: 1px solid var(--line); }
.ok { color: var(--seagrass); font-weight: 700; }
.missing { color: var(--coral); font-weight: 700; }

.done-screen { text-align: center; padding: 40px 20px; }
.done-screen .mark { width: 64px; height: 64px; border-radius: 50%; background: var(--seagrass); color: #fff; display: grid; place-items: center; font-size: 30px; margin: 0 auto 16px; }

@media (max-width: 900px) {
  .portal { grid-template-columns: 1fr; gap: 16px; }
  .rail { position: static; }
  .steps { display: flex; gap: 4px; overflow-x: auto; }
  .steps li { flex: none; }
  .review-grid { grid-template-columns: 1fr; }
  .panel { padding: 20px; }
}

/* ---------- Admin ---------- */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--paper); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { background: #EEF5F9; font-weight: 600; position: sticky; top: 0; }
.admin-table tr:last-child td { border-bottom: 0; }
.status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.status-invited { background: #E8EEF3; color: var(--ink-soft); }
.status-in_progress { background: var(--shallows-tint); color: #184B63; }
.status-submitted { background: var(--seagrass-tint); color: #1F5C48; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0 20px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; min-width: 150px; }
.stat b { display: block; font-size: 26px; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--ink-soft); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 280px; }
details.owner-detail { margin-top: 8px; }
details.owner-detail summary { cursor: pointer; color: var(--sea-deep); font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; margin: 10px 0; font-size: 14px; }
.detail-grid dt { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.detail-grid dd { margin: 0 0 6px; }
.diff { background: #FFF4D6; padding: 0 3px; border-radius: 3px; }
pre.codes { background: var(--paper); border: 1px solid var(--line); padding: 14px; border-radius: 10px; overflow: auto; font-size: 13px; }

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