/* ===== Medlive Video Presenter Test — v2 ===== */
:root {
    --purple: #5b2a86;
    --magenta: #b5179e;
    --blue: #1565d8;
    --blue-dark: #0f4fae;
    --ink: #1f2430;
    --muted: #6b7280;
    --line: #e6e8ee;
    --bg: #f4f5f9;
    --good: #15803d;
    --good-bg: #dcfce7;
    --warn: #b45309;
    --warn-bg: #fef3c7;
    --bad: #b91c1c;
    --bad-bg: #fee2e2;
    --card-shadow: 0 10px 30px rgba(31, 36, 48, 0.08);
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
}

/* ---- Header ---- */
.app-header {
    background: linear-gradient(100deg, var(--purple) 0%, var(--magenta) 100%);
    color: #fff;
    padding: 22px 24px;
}
.app-header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.app-header .logo { height: 38px; width: auto; filter: brightness(0) invert(1); }
.header-text h1 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.header-text p { margin: 2px 0 0; font-size: 0.9rem; opacity: 0.9; }

/* ---- Layout ---- */
.wrap { max-width: 960px; margin: 0 auto; padding: 26px 20px 60px; }

/* ---- Step nav ---- */
.steps {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.step {
    flex: 1 1 auto;
    min-width: 120px;
    border: none;
    background: #eceef4;
    color: var(--muted);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, color 0.2s;
}
.step .step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: #cfd3df; color: #fff; font-size: 0.72rem;
}
.step.is-active { background: var(--purple); color: #fff; }
.step.is-active .step-num { background: rgba(255,255,255,0.3); }
.step.is-done { background: #ede7f3; color: var(--purple); cursor: pointer; }
.step.is-done .step-num { background: var(--purple); }

/* ---- Card ---- */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 28px 30px;
}
.card h2 { margin: 0 0 4px; font-size: 1.3rem; }
.muted { color: var(--muted); margin: 0 0 20px; }
.opt { color: var(--muted); font-weight: 400; }

/* ---- Forms ---- */
.form { max-width: 460px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.field input {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line);
    border-radius: 8px; font-size: 0.95rem;
}
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21,101,216,0.15); }
.field-error { color: var(--bad); font-size: 0.85rem; min-height: 1em; margin: 0 0 8px; }

/* ---- Buttons ---- */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.btn {
    border: none; border-radius: 8px; padding: 11px 18px;
    font-size: 0.92rem; font-weight: 600; cursor: pointer; transition: background 0.15s, opacity 0.15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { background: #aab4c5; cursor: not-allowed; }
.btn-ghost { background: #eef0f5; color: var(--ink); }
.btn-ghost:hover { background: #e3e6ee; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #991b1b; }

/* ---- System check list ---- */
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line);
}
.check-list li:last-child { border-bottom: none; }
.check-info .check-title { font-weight: 600; font-size: 0.95rem; }
.check-info .check-detail { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.pill {
    font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 20px;
    white-space: nowrap;
}
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad  { background: var(--bad-bg);  color: var(--bad); }
.pill.run  { background: #e5e7eb; color: var(--muted); }

/* ---- Ready checklist ---- */
.ready-list { list-style: none; margin: 0; padding: 0; }
.ready-list li { padding: 6px 0; }
.ready-list label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.ready-list input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--purple); }
.ready-list .r-title { font-weight: 600; }
.ready-list .r-sub { color: var(--muted); font-size: 0.85rem; }

/* ---- Video stage ---- */
.stage { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.stage-single { grid-template-columns: 1fr; max-width: 680px; }
@media (max-width: 760px) { .stage { grid-template-columns: 1fr; } }

.video-frame {
    position: relative; background: #0d0f14; border-radius: 12px; overflow: hidden;
    aspect-ratio: 16 / 9;
}
.video-frame video { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
/* the recorded clip is not mirrored — show it true-to-life */
#review-video { transform: none; background: #000; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* badges anchor to opposite corners so a label change in one never pushes the other */
.badge-row { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 8px; flex-wrap: nowrap; justify-content: space-between; }
.badge {
    font-size: 0.72rem; font-weight: 700; padding: 5px 10px; border-radius: 7px;
    background: rgba(15,17,20,0.6); color: #fff; backdrop-filter: blur(2px);
    white-space: nowrap;
}
.badge.good { background: var(--good); }
.badge.warn { background: var(--warn); }
.badge.bad  { background: var(--bad); }
#rec-indicator { background: var(--bad); }
#rec-indicator.idle { background: rgba(15,17,20,0.6); }

.mic-meter { position: absolute; bottom: 10px; left: 10px; right: 10px; display: flex; align-items: center; gap: 8px; }
.mic-label { font-size: 0.7rem; color: #fff; font-weight: 700; min-width: 26px; }
.mic-track { flex: 1; height: 8px; background: rgba(255,255,255,0.25); border-radius: 5px; overflow: hidden; }
.mic-fill { height: 100%; width: 0%; background: #22c55e; transition: width 0.08s linear; }
.mic-fill.hot { background: #ef4444; }

/* ---- Tips ---- */
.tips { display: flex; flex-direction: column; gap: 12px; }
.tip { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tip h4 { margin: 0 0 3px; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.tip p { margin: 0; font-size: 0.82rem; color: var(--muted); }
.tip .dot { width: 9px; height: 9px; border-radius: 50%; background: #cfd3df; flex: none; }
.tip.good .dot { background: var(--good); }
.tip.warn .dot { background: var(--warn); }
.tip.bad .dot { background: var(--bad); }

/* ---- Record progress ---- */
.rec-progress { height: 6px; background: var(--line); border-radius: 4px; margin: 16px 0 0; overflow: hidden; max-width: 680px; }
.rec-progress-fill { height: 100%; width: 0%; background: var(--bad); transition: width 0.2s linear; }

/* ---- Review summary ---- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 0; }
.summary .s-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.summary .s-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.summary .s-value { font-weight: 700; margin-top: 4px; }
.summary .s-value.good { color: var(--good); }
.summary .s-value.warn { color: var(--warn); }
.summary .s-value.bad { color: var(--bad); }

.next-steps { background: #f7f5fb; border: 1px solid #e7e0f1; border-radius: 10px; padding: 14px 16px; margin-top: 18px; }
.next-steps strong { display: block; margin-bottom: 4px; }
.next-steps p { margin: 0; font-size: 0.88rem; color: var(--muted); }

/* ---- Footer ---- */
.app-footer { text-align: center; color: var(--muted); font-size: 0.82rem; margin-top: 30px; }
.app-footer .chrome { color: #1a73e8; font-weight: 600; }
.app-footer .edge { color: #0c8ce9; font-weight: 600; }
