/* RouteWise customer accounts: account/login.html and account/index.html. Loaded after ../css/site.css
   (colours, type, buttons, header and footer come from there). */

/* ---------- form parts (both pages) ---------- */
.field { display: grid; gap: 7px; align-content: start; }
.field > label { margin-bottom: 0; }
.field > label, .field-label { font-size: .875rem; font-weight: 620; color: var(--ink); }
.field .hint { font-size: .8125rem; color: var(--ink-3); }
.input {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px;
  border: 1px solid #D5D8CF; background: var(--white); color: var(--ink);
  font: inherit; font-size: 1rem; transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 38px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%234A504B' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") right 14px center / 12px no-repeat; }
.input:hover { border-color: #B9BDB2; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(96, 243, 18, .35); }
.input[aria-invalid="true"] { border-color: #B42318; box-shadow: 0 0 0 4px rgba(180, 35, 24, .12); }
.input[readonly] { background: var(--panel); color: var(--ink-2); }
.status { min-height: 1.4em; margin: 0; font-size: .9rem; font-weight: 560; color: var(--ink-2); }
.status.error { color: #B42318; }
.status.ok { color: var(--green-text); }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--green-text); font: inherit; font-weight: 640; font-size: .9rem; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(63, 98, 18, .35); text-underline-offset: 3px; }
.linkish:hover { text-decoration-color: currentColor; }
.check-line { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink-2); cursor: pointer; user-select: none; }
.box { appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border-radius: 6px; border: 1.5px solid #B9BDB2; background: var(--white) center / 14px no-repeat; cursor: pointer; transition: background-color .15s, border-color .15s; }
.box:checked { background-color: var(--green); border-color: var(--edge); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.2l2.6 2.5L11 4.4' fill='none' stroke='%231A2E05' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.pw { position: relative; }
.pw .input { padding-right: 76px; }
.peek { position: absolute; right: 6px; top: 6px; height: 36px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: .82rem; font-weight: 650; cursor: pointer; }
.peek:hover { color: var(--ink); background: var(--panel); }

/* busy / done states of the main buttons */
.submit { position: relative; min-height: 52px; width: 100%; }
.submit .spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(26, 46, 5, .25); border-top-color: var(--on-green); animation: rw-spin .7s linear infinite; }
.submit.busy .spin { display: block; }
.submit.busy .label { opacity: .7; }
.submit .tick { display: none; width: 22px; height: 22px; }
.submit.done .tick { display: block; }
.submit.done .label, .submit.done .spin { display: none; }
.submit .tick path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.submit.done .tick path { animation: rw-tick .45s var(--ease-out) forwards; }
@keyframes rw-spin { to { transform: rotate(360deg); } }
@keyframes rw-tick { to { stroke-dashoffset: 0; } }

/* ---------- account page ---------- */
.acct { width: min(var(--max), 100% - 2 * var(--gutter)); margin: 0 auto; padding: 40px 0 96px; }
.acct-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tile { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 18px; box-shadow: inset 0 0 0 1px rgba(30, 35, 32, .08); }
.tile svg { width: 58%; height: 58%; }
.acct-head h1 { font-size: clamp(1.7rem, 2.2vw + 1rem, 2.4rem); letter-spacing: -.035em; line-height: 1.1; }
.acct-head .who { margin: 4px 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.acct-head .btn { margin-left: auto; min-height: 44px; }

/* the trial, drawn as a 14-stop route: one stop per day, lit up to today */
.trial { margin-top: 32px; padding: 26px 28px 24px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.trial-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; }
.trial-top h2 { font-size: 1.25rem; letter-spacing: -.02em; }
.trial-top .left { font-size: .95rem; font-weight: 650; color: var(--green-text); }
.trial-route { display: block; width: 100%; height: 56px; margin: 18px 0 10px; overflow: visible; }
.trial-route .road { fill: none; stroke: var(--line); stroke-width: 4; stroke-linecap: round; }
.trial-route .done { fill: none; stroke: var(--edge); stroke-width: 4; stroke-linecap: round; }
.trial-route .stop { fill: var(--white); stroke: #C9CDC2; stroke-width: 2; }
.trial-route .stop.past { fill: var(--green); stroke: var(--edge); }
.trial-route .stop.today { fill: var(--ink); stroke: var(--green); stroke-width: 3.5; }
.trial-route .flag { font: 600 11px Inter, system-ui, sans-serif; fill: var(--ink-3); }
.trial-route .flag.end { text-anchor: end; }
.trial-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; color: var(--ink-2); font-size: .95rem; }
.trial-foot p { margin: 0; max-width: 46em; }
.trial-foot .btn { min-height: 44px; }
.trial.over .trial-top .left { color: #B42318; }

.acct-grid { display: grid; grid-template-columns: 220px 1fr; gap: 40px; margin-top: 40px; align-items: start; }
.acct-side { position: sticky; top: 88px; display: grid; gap: 2px; }
.acct-side a { display: block; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 560; font-size: .95rem; text-decoration: none; }
.acct-side a:hover { background: var(--panel); color: var(--ink); }
.acct-side a[aria-current="true"] { background: var(--tint); color: var(--on-green); box-shadow: inset 3px 0 0 var(--green); }
.acct-main { display: grid; gap: 24px; min-width: 0; }
.card { padding: 26px 28px 28px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); scroll-margin-top: 88px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.card h2 { font-size: 1.2rem; letter-spacing: -.02em; }
.card .intro { margin: 0 0 20px; color: var(--ink-2); font-size: .95rem; max-width: 40em; }
.saved { font-size: .8125rem; font-weight: 620; color: var(--ink-3); white-space: nowrap; transition: color .2s; }
.saved.ok { color: var(--green-text); }
.saved.error { color: #B42318; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-grid .wide { grid-column: 1 / -1; }
.sub-h { margin: 4px 0 10px; font-size: .875rem; font-weight: 620; }

/* icon picker */
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 10px; margin-bottom: 18px; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pick span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); transition: border-color .15s, background .15s, transform .12s ease-out; }
.pick span svg { width: 24px; height: 24px; }
.pick:hover span { border-color: #B9BDB2; }
.pick input:checked + span { background: var(--tint); border-color: var(--edge); box-shadow: inset 0 0 0 1px var(--edge); }
.pick input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.pick input:active + span { transform: scale(.94); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch span { display: block; width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(30, 35, 32, .12); transition: transform .12s ease-out; }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--ink); }
.swatch input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 4px; }
.swatch:hover span { transform: scale(1.08); }

/* segmented choice (best way to reach me) */
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--panel); flex-wrap: wrap; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 8px 16px; border-radius: 9px; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.seg input:checked + span { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(30, 35, 32, .12); }
.seg input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 1px; }

/* switches (emails, permission to contact) */
.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.switch-row:first-of-type { border-top: 0; padding-top: 4px; }
.switch-row b { display: block; font-weight: 640; }
.switch-row .cd { display: block; margin-top: 2px; color: var(--ink-2); font-size: .9rem; }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 46px; height: 28px; margin: 2px 0 0; border-radius: 999px; background: #D5D8CF; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease-out); }
.switch:checked { background: var(--edge); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* social links */
.socials { display: grid; gap: 10px; margin-bottom: 12px; }
.social-row { display: grid; grid-template-columns: 150px 1fr 44px; gap: 10px; }
.icon-btn { display: grid; place-items: center; width: 44px; min-height: 48px; border-radius: 12px; border: 1px solid #D5D8CF; background: var(--white); color: var(--ink-2); cursor: pointer; font-size: 1.2rem; line-height: 1; }
.icon-btn:hover { border-color: #B42318; color: #B42318; }
.counter { font-size: .8125rem; color: var(--ink-3); text-align: right; }

/* downloads and plan */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dl { display: grid; gap: 6px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .12s ease-out; }
.dl:hover { border-color: var(--edge); }
.dl:active { transform: scale(.985); }
.dl b { font-size: 1rem; }
.dl span { color: var(--ink-2); font-size: .9rem; }
.dl em { font-style: normal; font-weight: 650; font-size: .9rem; color: var(--green-text); }
.empty { padding: 18px 20px; border-radius: 14px; border: 1px dashed #C9CDC2; color: var(--ink-2); font-size: .95rem; }
.row-btns { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-btns .btn { min-height: 44px; }
.btn-quiet { background: var(--white); color: #B42318; border-color: #E8C9C5; }
.btn-quiet:hover { border-color: #B42318; }
.notice { margin: 24px 0 0; padding: 14px 18px; border-radius: 12px; background: #FFF4E5; color: #5A3A00; font-size: .95rem; }
.loading .acct-main, .loading .trial { opacity: .45; pointer-events: none; }

@media (max-width: 960px) {
  .acct-grid { grid-template-columns: 1fr; gap: 20px; }
  .acct-side { position: sticky; top: 64px; z-index: 5; display: flex; overflow-x: auto; gap: 6px; padding: 10px 0; margin: 0 calc(-1 * var(--gutter)); padding-inline: var(--gutter); background: rgba(250, 250, 247, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); scrollbar-width: none; }
  .acct-side a { white-space: nowrap; border: 1px solid var(--line); background: var(--white); }
  .acct-side a[aria-current="true"] { box-shadow: none; border-color: var(--edge); }
  .card { scroll-margin-top: 130px; }
}
@media (max-width: 640px) {
  .acct { padding-top: 28px; }
  .acct-head .btn { margin-left: 0; }
  .card, .trial { padding: 22px 18px; }
  .form-grid, .tiles { grid-template-columns: 1fr; }
  .social-row { grid-template-columns: 1fr 44px; }
  .social-row select { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .switch::after, .pick span, .swatch span, .dl { transition: none; }
}
