/* Verge entry — shared styles. Dark photo backdrop, warm bronze accent, light form panels. */
:root {
  --bronze: #b5a491;
  --bronze-strong: #9f8b7a;
  --bronze-deep: #776b58;
  --ink: #1d1a17;
  --ink-soft: #5f574e;
  --line: #e4ddd3;
  --panel: #fbf9f6;
  --field: #ffffff;
  --danger: #b4412f;
  --ok: #3f7a4e;
  --glass: rgba(18, 16, 14, 0.62);
  --glass-line: rgba(255, 255, 255, 0.14);
  --radius: 14px;
  --font: "Helvetica Neue", Helvetica, -apple-system, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: #fff;
  background: #141210;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* Backdrop: the office tower photo, darkened so text and panels read clearly. */
.backdrop {
  position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(15, 13, 11, 0.55) 0%, rgba(15, 13, 11, 0.35) 40%, rgba(15, 13, 11, 0.85) 100%),
    url("/img/bg.jpg") center 30% / cover no-repeat;
}

.shell { max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px; min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: block; height: 26px; width: auto; filter: brightness(1.45); }
.back { display: inline-flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, 0.78); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--bronze); }
.back svg { width: 16px; height: 16px; }

/* Signed-in person, top left of every page (shared with the website and Training Log). */
.brand { display: flex; align-items: center; gap: 18px; }
.account { position: relative; font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.account summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 3px 12px 3px 3px;
  border: 1px solid var(--glass-line); border-radius: 999px; background: rgba(18, 16, 14, 0.35); }
.account summary::-webkit-details-marker { display: none; }
.account summary:hover, .account[open] summary { border-color: rgba(181, 164, 145, 0.6); }
.account summary:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center;
  justify-content: center; background: var(--bronze-deep); color: #fff; font-size: 12px; letter-spacing: 0.5px; }
.account-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: absolute; left: 0; top: calc(100% + 8px); z-index: 20; min-width: 230px; padding: 8px 0;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28); }
.account-who { display: flex; flex-direction: column; gap: 2px; padding: 6px 16px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.account-who span { color: var(--ink-soft); font-size: 12px; }
.account-menu a { display: block; padding: 8px 16px; text-decoration: none; }
.account-menu a:hover { background: #f1ece5; color: var(--bronze-deep); }
.account-signin { text-decoration: none; padding: 7px 14px; border: 1px solid var(--glass-line); border-radius: 999px; }
.account-signin:hover { color: var(--bronze); border-color: rgba(181, 164, 145, 0.6); }
@media (max-width: 640px) { .account-name { display: none; } .account summary { padding-right: 3px; } .brand { gap: 12px; } }

/* Date block, carried over from the old entry page. */
.date { display: flex; align-items: stretch; border: 1px solid rgba(255, 255, 255, 0.4); color: rgba(255, 255, 255, 0.8); }
.date .day { font-size: 44px; font-weight: 600; line-height: 1; padding: 8px 14px; border-right: 1px solid rgba(255, 255, 255, 0.4); font-variant-numeric: tabular-nums; }
.date .my { display: flex; flex-direction: column; justify-content: center; padding: 0 14px; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; gap: 4px; }
.date .my span:last-child { color: rgba(255, 255, 255, 0.5); }

/* ---------- entry page ---------- */
.hero { margin-top: auto; padding-top: 72px; }
.eyebrow { font-size: 12px; letter-spacing: 4px; text-transform: uppercase; color: var(--bronze); margin: 0 0 12px; }
.hero .eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.hero .eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--bronze); }

.doors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.door {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 26px 24px 22px; min-height: 210px;
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  text-decoration: none; color: #fff;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.door:hover, .door:focus-visible { transform: translateY(-3px); border-color: var(--bronze); background: rgba(24, 21, 18, 0.74); outline: none; }
.door .icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: rgba(181, 164, 145, 0.16); color: var(--bronze); }
.door .icon svg { width: 22px; height: 22px; }
.door h2 { font-size: 20px; font-weight: 600; margin: 8px 0 0; }
.door p { margin: 0; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, 0.68); }
.door .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: rgba(255, 255, 255, 0.55); padding-top: 14px; }
.door .go { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); display: grid; place-items: center; transition: background 0.18s, border-color 0.18s, color 0.18s; }
.door .go svg { width: 15px; height: 15px; }
.door:hover .go { background: var(--bronze); border-color: var(--bronze); color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 5px; }
.tag svg { width: 13px; height: 13px; }

.footer { margin-top: 40px; font-size: 12px; color: rgba(255, 255, 255, 0.4); letter-spacing: 1px; }

/* ---------- form pages ---------- */
/* Form pages use a tighter shell so the whole form fits on one laptop screen. */
.shell.compact { padding-top: 22px; padding-bottom: 28px; }
.form-wrap { width: 100%; max-width: 900px; margin: 22px auto 0; }
.panel { background: var(--panel); color: var(--ink); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06); overflow: hidden; }

.panel-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 22px 30px 20px; color: #fff; position: relative;
  background: linear-gradient(120deg, #221e1a 0%, #352e27 60%, #4a3f33 100%);
}
.panel-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--bronze), rgba(181, 164, 145, 0)); }
.panel-head .eyebrow { margin: 0 0 6px; font-size: 11px; letter-spacing: 3.5px; }
.panel-head h1 { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -0.2px; }
.panel-head p { margin: 5px 0 0; font-size: 13px; color: rgba(255, 255, 255, 0.62); line-height: 1.45; }
.stamp { flex: none; text-align: right; border-left: 1px solid rgba(255, 255, 255, 0.16); padding-left: 18px; }
.stamp small { display: block; font-size: 10.5px; letter-spacing: 2.5px; text-transform: uppercase; color: rgba(255, 255, 255, 0.5); margin-bottom: 4px; }
.stamp b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.5px; color: #fff; }

.panel-body { padding: 22px 30px 24px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.grid .span2 { grid-column: 1 / -1; }
.field { min-width: 0; }

label, .label { display: flex; align-items: baseline; gap: 2px; font-size: 12.5px; font-weight: 600; color: #3b352f; margin-bottom: 6px; letter-spacing: 0.15px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.label-row .label { margin: 0; }
.req { color: var(--danger); }
.opt { font-weight: 400; color: #a1978b; margin-left: 4px; }

input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--ink);
  background: var(--field); border: 1px solid #ddd5ca; border-radius: 9px;
  padding: 10px 12px; height: 42px; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: #b0a698; }
input:hover, select:hover, textarea:hover { border-color: #c9bfb2; }
select {
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235f574e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
select:invalid { color: #a1978b; }
textarea { height: 132px; resize: none; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bronze-strong); box-shadow: 0 0 0 3px rgba(159, 139, 122, 0.2); }
.money { position: relative; }
.money span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-size: 14.5px; pointer-events: none; }
.money input { padding-left: 25px; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Segmented choice (Transaction Type). */
.seg { display: flex; height: 42px; background: #ede7df; border-radius: 9px; padding: 3px; gap: 3px; }
.seg label { flex: 1; margin: 0; position: relative; display: block; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg span { display: flex; align-items: center; justify-content: center; height: 100%; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--ink-soft); transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.seg label:hover span { color: var(--ink); }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04); font-weight: 600; }
.seg input:focus-visible + span { box-shadow: 0 0 0 2px var(--bronze-strong); }

.invalid input, .invalid select, .invalid textarea, .invalid .sigpad, .invalid .drop { border-color: var(--danger) !important; }
.invalid .seg { box-shadow: inset 0 0 0 1px var(--danger); }
.err { display: none; color: var(--danger); font-size: 12px; margin-top: 5px; }
.invalid .err { display: block; }

/* Signature pad: same height as the Memo box beside it. */
.sigpad { position: relative; border: 1px solid #ddd5ca; border-radius: 9px; background: #fff; height: 132px; touch-action: none; }
.sigpad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; border-radius: 9px; }
.sigpad .baseline { position: absolute; left: 20px; right: 20px; bottom: 30px; border-bottom: 1px dashed #d3c9bc; pointer-events: none; }
.sigpad .placeholder { position: absolute; left: 20px; bottom: 37px; font-size: 13px; color: #b9afa2; pointer-events: none; display: flex; align-items: center; gap: 6px; }
.sigpad .placeholder svg { width: 15px; height: 15px; }
.sigpad.signed .placeholder { display: none; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; }
.linkbtn:hover { color: var(--danger); text-decoration: underline; }

/* File drop zone (DDC driver's licenses): same height as the Memo box beside it. */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 132px; border: 1.5px dashed #cbbfae; border-radius: 9px; text-align: center; cursor: pointer; background: #fff; transition: border-color 0.15s, background 0.15s; font-weight: 400; margin: 0; padding: 10px; }
.drop:hover, .drop.over { border-color: var(--bronze-strong); background: #fdfaf6; }
.drop svg { width: 24px; height: 24px; color: var(--bronze-strong); }
.drop strong { display: block; font-size: 13.5px; margin-top: 6px; color: var(--ink); font-weight: 600; }
.drop small { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.drop input { display: none; }
.files { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.files li { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 5px 6px 5px 10px; background: #f0eae2; border-radius: 7px; font-size: 12.5px; }
.files li .name { min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li .size { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.files li button { border: 0; background: none; cursor: pointer; color: var(--ink-soft); font-size: 16px; line-height: 1; padding: 0 3px; }
.files li button:hover { color: var(--danger); }

.actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.actions .legend { font-size: 12px; color: #a1978b; }
.btn {
  appearance: none; border: 0; border-radius: 10px; padding: 12px 28px; min-width: 180px;
  font: inherit; font-size: 14.5px; font-weight: 600; letter-spacing: 0.3px;
  background: var(--ink); color: #fff; cursor: pointer; transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn svg { width: 16px; height: 16px; transition: transform 0.15s; }
.btn:hover { background: #3a332c; box-shadow: 0 6px 18px rgba(29, 26, 23, 0.25); }
.btn:hover svg { transform: translateX(2px); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
a.btn { text-decoration: none; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid #cfc6ba; box-shadow: none; }
.btn.secondary:hover { background: #f1ece5; }
.btn.block { width: 100%; }

.alert { display: none; border-radius: 9px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 16px; }
.alert.show { display: block; }
.alert.error { background: #fbece9; color: var(--danger); border: 1px solid #f0cdc6; }

/* Success state. */
.done { display: none; text-align: center; padding: 44px 32px 40px; }
.done.show { display: block; }
.done .check { width: 60px; height: 60px; border-radius: 50%; background: #e7f1e9; color: var(--ok); display: grid; place-items: center; margin: 0 auto 16px; }
.done .check svg { width: 28px; height: 28px; }
.done h2 { margin: 0 0 6px; font-size: 21px; }
.done p { margin: 0 0 24px; color: var(--ink-soft); font-size: 14.5px; }
.done .buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Sign-in page. */
.login { max-width: 420px; margin-top: 12vh; }
.login .panel-head { display: block; }
.login .actions { border-top: 0; padding-top: 0; margin-top: 18px; }

.note { font-size: 12.5px; color: rgba(255, 255, 255, 0.5); text-align: center; margin-top: 16px; }
.note a { color: rgba(255, 255, 255, 0.7); }
.note b { font-weight: 500; color: rgba(255, 255, 255, 0.75); }

.gbtn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  padding: 12px 18px; border: 1px solid #d6cdc1; border-radius: 10px; background: #fff;
  font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.gbtn:hover { background: #fdfbf8; border-color: #bfb3a4; box-shadow: 0 4px 14px rgba(29, 26, 23, 0.12); }
.gbtn svg { width: 20px; height: 20px; flex: none; }
.fine { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); text-align: center; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .doors { grid-template-columns: 1fr; gap: 12px; }
  .door { min-height: 0; padding: 20px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
  .door .icon { flex: none; }
  .door .text { flex: 1; min-width: 0; }
  .door h2 { margin: 0; font-size: 18px; }
  .door p { font-size: 13.5px; }
  .door .foot { width: 100%; padding-top: 8px; }
  .hero { padding-top: 48px; }
  .hero .eyebrow { margin-bottom: 16px; white-space: nowrap; }
}
@media (max-width: 640px) {
  .hero .eyebrow { font-size: 11px; letter-spacing: 2.5px; gap: 10px; }
  .hero .eyebrow::before { width: 20px; }
  .shell { padding: 20px 16px 32px; }
  .logo { height: 20px; }
  .date .day { font-size: 32px; padding: 6px 10px; }
  .date .my { padding: 0 10px; font-size: 10px; letter-spacing: 2px; }
  .form-wrap { margin-top: 16px; }
  .panel-head { padding: 20px 20px 18px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .stamp { text-align: left; border-left: 0; padding-left: 0; display: flex; align-items: baseline; gap: 8px; }
  .stamp small { margin: 0; }
  .stamp b { font-size: 14px; }
  .panel-body { padding: 20px 20px 22px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  textarea { height: 100px; }
  .actions { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .actions .legend { text-align: center; }
  .btn { width: 100%; }
  .done { padding: 32px 20px; }
  .login { margin-top: 8vh; }
}
/* Phone held sideways (wide but short): four doors side by side, compact headers. */
@media (orientation: landscape) and (max-height: 500px) {
  .shell { padding: 14px 24px 20px; }
  .logo { height: 20px; }
  .date .day { font-size: 28px; padding: 5px 10px; }
  .date .my { padding: 0 10px; font-size: 10px; letter-spacing: 2px; }
  .hero { padding-top: 18px; }
  .eyebrow { margin-bottom: 6px; }
  .hero .eyebrow { margin-bottom: 12px; }
  .doors { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .door { flex-direction: column; flex-wrap: nowrap; align-items: stretch; min-height: 0; padding: 14px 14px 12px; gap: 6px; }
  .door .icon { width: 34px; height: 34px; }
  .door .icon svg { width: 18px; height: 18px; }
  .door h2 { font-size: 16px; margin: 2px 0 0; }
  .door p { font-size: 12.5px; line-height: 1.4; }
  .door .foot { padding-top: 6px; font-size: 11.5px; }
  .door .go { width: 26px; height: 26px; }
  .footer { margin-top: 14px; }

  .form-wrap { margin-top: 12px; }
  .panel-head { padding: 14px 24px 12px; flex-direction: row; align-items: center; }
  .panel-head .eyebrow { display: none; }
  .panel-head h1 { font-size: 19px; }
  .panel-head p { font-size: 12px; margin-top: 3px; }
  .stamp b { font-size: 15px; }
  .panel-body { padding: 16px 24px 18px; }
  .login { margin-top: 4vh; }
}

/* Touch screens: 16px text in fields, otherwise iPhone Safari zooms the page in on every tap. */
@media (pointer: coarse) {
  input[type=text], input[type=email], input[type=password], select, textarea, .money span { font-size: 16px; }
  input[type=text], input[type=email], input[type=password], select { height: 44px; }
  .seg { height: 44px; }
  .linkbtn { font-size: 14px; padding: 4px 0 4px 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
