/* A driver's own pages - Pages/Me/** and Pages/Account/Welcome (MainClass "page me-page").
   My videos (the list), the upload / edit form, and the account set-up form. Thumbnails,
   status pills and the progress bar are components/video-card.css. */

.me-narrow { max-width: 34rem; }

.me-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.25rem; }
.me-head-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.me-head-actions .cta, .up-actions .cta, .me-actions .cta { padding: .7rem 1.3rem; font-size: .95rem; }
.me-page .cta-solid { background-color: var(--red-strong); }

.me-flash {
    margin: 1.75rem 0 0; padding: .7rem 1rem;
    border: 1px solid var(--border); border-left: 4px solid var(--green-ink); border-radius: .6rem;
    background: var(--surface); font-size: .9rem; color: var(--ink-soft);
}

.me-back { display: inline-block; font-size: .9rem; font-weight: 600; color: var(--blue-ink); }
.me-back:hover { color: var(--red-ink); }
.me-title { margin-top: 1rem; }

/* ---------- My videos ---------- */
.me-counts { margin-top: 2rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.me-count { display: flex; flex-direction: column; padding: .9rem 1.1rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); }
.me-count-n { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; line-height: 1.1; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.me-count-n.is-live { color: var(--green-ink); }
.me-count-n.is-review { color: var(--blue-ink); }
.me-count-n.is-changes { color: var(--amber-ink); }
.me-count-l { font-size: .8rem; color: var(--muted); }

.me-empty { display: grid; gap: 1rem; justify-items: start; }
.me-empty p { margin: 0; }

.myv-list { list-style: none; margin: 1.5rem 0 0; padding: 0; border: 1px solid var(--border); border-radius: .9rem; background: var(--surface); }
.myv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; padding: 1rem 1.25rem; }
.myv-row + .myv-row { border-top: 1px solid var(--border); }
.myv-body { flex: 999 1 16rem; min-width: 0; }
.myv-title { margin: 0; font-weight: 600; line-height: 1.3; }
.myv-meta { margin: .2rem 0 0; font-size: .82rem; color: var(--muted); }
.myv-row .vprogress { margin-top: .65rem; max-width: 22rem; }
.myv-note-line { margin: .4rem 0 0; font-size: .8rem; color: var(--muted); }
.myv-note {
    margin: .65rem 0 0; max-width: 36rem; padding: .6rem .8rem; border-radius: .55rem;
    background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--ink);
    font-size: .84rem; line-height: 1.45;
}
.myv-note.is-bad { background: color-mix(in srgb, var(--red-strong) 7%, var(--surface)); border-color: color-mix(in srgb, var(--red-strong) 30%, var(--border)); }
.me-review-note { margin-top: 1.25rem; }

.myv-actions { display: flex; align-items: center; gap: .25rem; }
.myv-actions > a { padding: .7rem .75rem; border-radius: .5rem; font-size: .88rem; font-weight: 600; color: var(--blue-ink); }
.myv-actions > a:hover { background: var(--surface-2); }

/* The ··· menu - <details>, so it opens with no script and closes on a second press. */
.myv-menu { position: relative; }
.myv-menu summary {
    list-style: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
    border-radius: .5rem; color: var(--ink-soft); cursor: pointer;
}
.myv-menu summary::-webkit-details-marker { display: none; }
.myv-menu summary:hover, .myv-menu[open] summary { background: var(--surface-2); }
.myv-menu-panel {
    position: absolute; right: 0; top: calc(100% + .25rem); z-index: 5; min-width: 13rem;
    padding: .35rem; border: 1px solid var(--border); border-radius: .7rem;
    background: var(--surface); box-shadow: var(--shadow-lg);
}
.myv-menu-panel form { margin: 0; }
.myv-menu-panel button {
    display: block; width: 100%; padding: .65rem .75rem; border: 0; border-radius: .45rem;
    background: none; text-align: left; font: inherit; font-size: .88rem; color: var(--ink); cursor: pointer;
}
.myv-menu-panel button:hover { background: var(--surface-2); }
.myv-menu-panel button.is-danger { color: var(--red-ink); }

.me-signout { margin-top: 2.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); }
.me-signout button { border: 0; background: none; padding: .5rem; font: inherit; font-weight: 600; color: var(--blue-ink); cursor: pointer; }

/* ---------- Cards and fields (upload form, account set-up) ---------- */
.me-card { border: 1px solid var(--border); border-radius: .9rem; background: var(--surface); padding: 1.35rem 1.4rem; }
.me-card-title { margin: 0 0 1rem; font-size: 1.15rem; }
.me-card-kicker { margin: 0 0 .85rem; font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.me-form { display: grid; gap: 1.1rem; }
.me-form.me-card { margin-top: 1.5rem; }
.up-form .me-form.me-card { margin-top: 0; }
.me-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.me-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.me-field > label, .me-field > legend { padding: 0; font-weight: 600; font-size: .9rem; color: var(--ink); }
.me-optional { font-weight: 400; color: var(--muted); }
.me-field input:not([type="radio"]):not([type="checkbox"]), .me-field select, .me-field textarea {
    width: 100%; min-height: 2.9rem; padding: .6rem .85rem;
    border: 1px solid var(--muted); border-radius: .6rem; background: var(--surface);
    font: inherit; font-size: 1rem; color: var(--ink);
}
.me-field textarea { resize: vertical; line-height: 1.5; }
.me-field input:focus, .me-field select:focus, .me-field textarea:focus {
    outline: none; border-color: var(--blue);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent);
}
.me-help { margin: 0; font-size: .82rem; color: var(--muted); text-wrap: pretty; }
.me-error, .me-errors { color: var(--red-ink); font-size: .85rem; }
.me-errors ul { margin: 0 0 1rem; padding-left: 1.1rem; }
.me-errors.validation-summary-valid, .field-validation-valid.me-error { display: none; }
.me-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Sign in (Areas/Identity/Pages/Account/Login): the button, with "Forgot your password?" beside it. */
.login-actions { align-items: center; gap: .75rem 1.25rem; }
.login-forgot { font-weight: 600; font-size: .9rem; color: var(--blue-ink); }
.login-forgot:hover { color: var(--red-ink); }
.login-note { margin: 1rem 0 0; }

.me-check { display: flex; align-items: flex-start; gap: .75rem; cursor: pointer; }
.me-check input { flex: none; width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; accent-color: var(--red-strong); }
.me-check b { display: block; font-weight: 600; }
.me-check small { display: block; font-size: .82rem; color: var(--muted); }

/* ---------- Upload / edit ---------- */
.up-grid { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-start; }
.up-form { flex: 999 1 34rem; min-width: 0; display: grid; gap: 1.25rem; }
.up-side { flex: 1 1 18rem; min-width: 0; display: grid; gap: 1.25rem; }
.up-side .vcard-title { margin-top: .75rem; }

.up-drop {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: .6rem;
    padding: 2.5rem 1.5rem; border: 2px dashed var(--muted); border-radius: .9rem;
    background: var(--bg); text-align: center; cursor: pointer; color: var(--blue-ink);
    transition: border-color .15s ease, background-color .15s ease;
}
.up-drop:hover, .up-drop.is-over, .up-drop:focus-within { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.up-drop-main { font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.up-drop-main u { color: var(--blue-ink); }
.up-drop-sub { font-size: .82rem; color: var(--muted); }
.up-drop[hidden], .up-file[hidden], .up-resume[hidden] { display: none; }

.up-resume { display: grid; gap: .85rem; justify-items: start; padding: 1rem 1.1rem; border-radius: .75rem; background: var(--amber-bg); border: 1px solid var(--amber-line); }
.up-resume p { margin: 0; font-size: .92rem; }
.up-resume-pick { position: relative; cursor: pointer; }

.up-file { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: .75rem; }
.up-file-body { flex: 1 1 14rem; min-width: 0; }
.up-file-name { margin: 0 0 .55rem; font-weight: 600; font-size: .95rem; overflow-wrap: anywhere; }
.up-file-text { margin: .45rem 0 0; font-size: .85rem; color: var(--ink-soft); }
.up-file-btn { padding: .55rem 1rem; font-size: .88rem; }
[data-upload-hint], [data-upload-error] { margin-top: .75rem; }

.up-pills { margin-top: .5rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.up-pill { position: relative; cursor: pointer; }
.up-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.up-pill span {
    display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1.05rem;
    border-radius: 999px; border: 1px solid var(--muted); background: var(--surface);
    font-size: .92rem; font-weight: 500; color: var(--ink);
}
.up-pill input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
.up-pill input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

.up-frames { margin-top: .85rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.up-frame { position: relative; display: block; cursor: pointer; border-radius: .6rem; }
.up-frame img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .6rem; border: 3px solid transparent; background: var(--thumb-bg); }
.up-frame input:checked + img { border-color: var(--red-strong); }
.up-frame input:focus-visible + img { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Her own thumbnail: the image tile (once there is one) and the upload tile beside it. */
.up-own { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.up-frame-upload {
    display: grid; place-items: center; aspect-ratio: 16 / 9;
    border: 2px dashed var(--muted); border-radius: .6rem; background: var(--bg);
    font-weight: 600; font-size: .88rem; color: var(--blue-ink);
}
.up-frame-upload:hover, .up-frame-upload:focus-within { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }

/* Key moments: the player, the "add a moment here" button, then the rows - time, label,
   play from here, remove - with any errors wrapping underneath. */
.up-moments { display: grid; gap: .85rem; }
.up-moments .me-card-title { margin-bottom: 0; }
.up-moment-player:empty { display: none; }
.up-moment-wait {
    margin: 0; padding: 1.25rem; border: 2px dashed var(--border); border-radius: .75rem;
    font-size: .88rem; color: var(--muted); text-align: center;
}
.up-moment-here { justify-self: start; display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1.1rem; font-size: .92rem; }
.up-moment-here[hidden] { display: none; }
.up-moment-here [data-moment-here-time] { font-variant-numeric: tabular-nums; }
.up-moment-here:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.up-moment-rows { display: grid; gap: .5rem; }
.up-moment { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 2.75rem 2.75rem; gap: .5rem; align-items: center; }
.up-moment input {
    width: 100%; min-height: 2.75rem; padding: .5rem .8rem;
    border: 1px solid var(--muted); border-radius: .6rem; background: var(--surface);
    font: inherit; font-size: 1rem; color: var(--ink);
}
.up-moment input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent); }
.up-moment-time { font-variant-numeric: tabular-nums; }
.up-moment-icon {
    width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
    border: 0; border-radius: .5rem; background: transparent; color: var(--muted); cursor: pointer;
}
.up-moment-icon:hover { background: var(--surface-2); color: var(--ink); }
.up-moment-icon:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
/* Nothing to play yet: no "play from here" buttons. */
.up-moments:not(:has(video)) [data-moment-seek] { visibility: hidden; }
.up-moment-error { grid-column: 1 / -1; }
.up-moment-error:empty, .up-moment-error.field-validation-valid { display: none; }
.up-moment-add {
    justify-self: start; min-height: 2.75rem; padding: 0 .25rem;
    border: 0; background: none; font: inherit; font-weight: 600; font-size: .92rem; color: var(--blue-ink); cursor: pointer;
}
.up-moment-add[hidden] { display: none; }

.up-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.up-actions .me-help { flex: 1 1 16rem; }
.up-queued { margin: 0; padding: .7rem 1rem; border-radius: .6rem; background: color-mix(in srgb, var(--blue) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--border)); font-size: .9rem; }

.up-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .6rem; font-size: .88rem; line-height: 1.45; color: var(--ink-soft); }

/* On a phone the actions stay in reach: pinned to the bottom of the screen while the form scrolls. */
@media (max-width: 40rem) {
    .up-actions {
        position: sticky; bottom: 0; z-index: 4; margin-inline: calc(var(--gutter) * -1);
        padding: .75rem var(--gutter) 1rem; background: var(--surface); border-top: 1px solid var(--border);
    }
    .up-actions .cta { flex: 1 1 auto; text-align: center; }
    .up-actions .me-help { display: none; }
    .myv-row .vthumb-sm { width: 7rem; }
    .up-moment { grid-template-columns: 4.5rem minmax(0, 1fr) 2.75rem 2.75rem; gap: .35rem; }
    .me-card { padding: 1.1rem 1rem; }
}

/* ---------- Where a video shows (upload/edit) ---------- */
.up-where { margin: 0 0 .25rem; padding: 0; border: 0; display: grid; gap: .65rem; }
.me-check[hidden] { display: none; }

/* ---------- Tabs: My videos / My shareable page ---------- */
.me-tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--border); }
.me-tabs a {
    display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1rem; margin-bottom: -1px;
    border-bottom: 3px solid transparent; font-family: var(--font-display); font-weight: 600; font-size: .92rem; color: var(--muted);
}
.me-tabs a:hover { color: var(--ink); }
.me-tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--red-strong); }

.vtag-share { background: color-mix(in srgb, var(--blue-ink) 14%, var(--surface)); color: var(--blue-ink); }
.me-flash.is-bad { border-left-color: var(--red-ink); }

/* ---------- My shareable page ---------- */
.share-settings { margin-top: 1.75rem; display: grid; gap: 1.25rem; }
.share-link { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.share-link-main { flex: 999 1 22rem; min-width: 0; display: grid; gap: .85rem; }
.share-label { font-weight: 600; font-size: .9rem; }
.share-url-row { display: flex; gap: .5rem; }
.share-url-row input {
    flex: 1; min-width: 0; min-height: 2.9rem; padding: .5rem .8rem; border: 1px solid var(--muted); border-radius: .6rem;
    background: var(--bg); font: inherit; font-size: .95rem; color: var(--ink);
}
.share-url-row .cta { padding: .6rem 1.1rem; }
.share-actions { margin: 0; }
.share-actions .cta { padding: .6rem 1.1rem; font-size: .92rem; }
.share-manage { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.share-manage form { margin: 0; }
.share-text-btn {
    min-height: 2.75rem; padding: 0; border: 0; background: none; cursor: pointer;
    font: inherit; font-weight: 600; font-size: .88rem; color: var(--blue-ink);
}
.share-text-btn:hover { color: var(--red-ink); }
.share-qr { flex: 1 1 10rem; margin: 0; display: grid; justify-items: center; gap: .5rem; }
/* The code stays black on white in both themes: scanners need the contrast. */
.share-qr img { width: 10rem; height: 10rem; padding: .5rem; background: #fff; border-radius: .6rem; border: 1px solid var(--border); }
.share-qr figcaption { font-size: .82rem; color: var(--muted); }
.share-qr a { font-weight: 600; color: var(--blue-ink); }

.share-state { margin: 0 0 .85rem; padding: .6rem .85rem; border-radius: .55rem; font-size: .88rem; border: 1px solid var(--border); background: var(--surface-2); }
.share-state.is-live { border-color: color-mix(in srgb, var(--green-ink) 40%, var(--border)); background: color-mix(in srgb, var(--green-ink) 8%, var(--surface)); }
.share-state.is-review { border-color: color-mix(in srgb, var(--blue-ink) 35%, var(--border)); background: color-mix(in srgb, var(--blue-ink) 8%, var(--surface)); }
.share-state.is-changes { border-color: var(--amber-line); background: var(--amber-bg); }
.share-state a { font-weight: 600; color: var(--blue-ink); margin-left: .35rem; }
.share-cv-upload { max-width: 28rem; }
.share-cv-remove { margin-top: 1rem; }

/* The one Submit for the intro, CV and videos: pinned to the bottom of the screen while the form
   scrolls, so it's in reach from any section. */
.share-submit {
    position: sticky; bottom: 0; z-index: 4;
    display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem;
    padding: .9rem 1.4rem; border: 1px solid var(--border); border-radius: .9rem;
    background: var(--surface);
}
.share-submit .me-help { flex: 1 1 18rem; margin: 0; }
.share-submit .cta { padding: .7rem 1.3rem; font-size: .95rem; }
.share-cv-upload.me-field input[type="file"] { min-height: 2.9rem; padding: .45rem .5rem; border: 1px solid var(--muted); border-radius: .6rem; background: var(--bg); color: var(--ink-soft); font: inherit; font-size: .9rem; }

.share-videos { list-style: none; margin: .5rem 0 1rem; padding: 0; display: grid; gap: .5rem; }
.share-video { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: .7rem; background: var(--bg); }
.share-video:has(input:checked) { border-color: color-mix(in srgb, var(--blue) 55%, var(--border)); background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.share-video-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: .75rem; cursor: pointer; }
.share-video-pick input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0; accent-color: var(--red-strong); }
.share-video-text { min-width: 0; display: grid; gap: .1rem; }
.share-video-text b { font-size: .92rem; line-height: 1.3; }
.share-video-text small { font-size: .78rem; color: var(--muted); }
.share-video-move { display: flex; flex: none; }
@media (max-width: 40rem) {
    .share-video .vthumb-xs { display: none; }
    .share-submit { margin-inline: calc(var(--gutter) * -1); padding: .75rem var(--gutter) 1rem; border-radius: 0; border-width: 1px 0 0; }
    .share-submit .me-help { display: none; }
    .share-submit .cta { flex: 1 1 auto; text-align: center; }
}
