/* Student device-bound QR app — single stylesheet for the register and QR
   pages. Deliberately framework-free and small so the service worker can
   precache it for offline use. */

:root {
    /* Kept identical to the :root in css/style.css (the admin side) so the
       student app and the dashboard read as one product. */
    --myqr-blue: #0984e3;
    --myqr-blue-dark: #0770c4;
    --myqr-bg: #f6f7f9;
    --myqr-card: #ffffff;
    --myqr-surface-2: #f4f6f8;
    --myqr-text: #2d3436;
    --myqr-muted: #64748b;
    --myqr-border: #e5e8ee;
    --myqr-border-soft: #edf0f4;
    --myqr-tint: #e7f2fc;
    --myqr-danger: #d63031;
    --myqr-success: #00b894;
}

* { box-sizing: border-box; }

body.myqr-body {
    margin: 0;
    padding: 0;
    background: var(--myqr-bg);
    color: var(--myqr-text);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

.myqr-shell {
    max-width: 520px;
    margin: 0 auto;
    padding: 18px 16px 40px;
}

.myqr-header h1 {
    font-size: 1.45rem;
    margin: 6px 0 2px;
}

.myqr-sub {
    margin: 0 0 8px;
    color: var(--myqr-muted);
    font-size: 0.92rem;
}

.myqr-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.myqr-badge {
    background: var(--myqr-tint);
    color: #0a4d7a;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
}

.myqr-badge-ok { background: #d6f7ec; color: #04634c; }
.myqr-badge-warn { background: #ffe7d6; color: #a8500a; }

.myqr-card {
    background: var(--myqr-card);
    border: 1px solid var(--myqr-border-soft);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
}

.myqr-card h2 { margin: 0 0 8px; font-size: 1.1rem; }

.myqr-warn { border-left: 4px solid var(--myqr-danger); }

.myqr-ok { color: var(--myqr-success); }

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 12px 0 4px;
}

input {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid var(--myqr-border);
    border-radius: 10px;
    background: #fff;
    color: var(--myqr-text);
}

.myqr-btn {
    display: inline-block;
    width: 100%;
    margin-top: 14px;
    padding: 13px 16px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.myqr-btn-primary { background: var(--myqr-blue); color: #fff; }
.myqr-btn-primary:active { background: var(--myqr-blue-dark); }

.myqr-btn-ghost {
    background: transparent;
    border: 1px solid var(--myqr-border);
    color: inherit;
}

.myqr-status { min-height: 1.2em; margin: 12px 0 0; font-size: 0.9rem; }
.myqr-status.is-error { color: var(--myqr-danger); }
.myqr-status.is-ok { color: var(--myqr-success); }

.myqr-note { color: var(--myqr-muted); font-size: 0.85rem; line-height: 1.45; }
.myqr-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.35;
}

.myqr-check input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--myqr-blue);
}

.myqr-diag {
    display: grid;
    grid-template-columns: minmax(120px, 42%) 1fr;
    gap: 4px 12px;
    margin: 12px 0 0;
    font-size: 0.82rem;
    word-break: break-word;
}

.myqr-diag dt { color: var(--myqr-muted); font-weight: 600; }.myqr-diag dd { margin: 0; }
.myqr-diag dd.is-error { color: var(--myqr-danger); font-weight: 700; }

details summary { cursor: pointer; }


.myqr-list { margin: 6px 0 0; padding-left: 18px; font-size: 0.9rem; line-height: 1.5; }
.myqr-list li { margin-bottom: 6px; }

.myqr-qr-card { text-align: center; }

.myqr-qr-wrap {
    position: relative;
    width: min(78vw, 320px);
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}

.myqr-qr {
    position: absolute;
    inset: 10%;
    background: #fff;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.myqr-qr svg { width: 100%; height: auto; display: block; }

.myqr-ring {
    position: absolute;
    inset: 0;
    transform: rotate(-90deg);
    pointer-events: none;
}

.myqr-ring-track,
.myqr-ring-progress {
    fill: none;
    stroke-width: 4;
}

.myqr-ring-track { stroke: var(--myqr-border); }

.myqr-ring-progress {
    stroke: var(--myqr-success);
    stroke-linecap: round;
    stroke-dasharray: 289;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.25s linear, stroke 0.25s linear;
}

.myqr-refresh { margin: 10px 0 0; font-weight: 700; }

.myqr-footer { text-align: center; margin-top: 18px; font-size: 0.85rem; }
.myqr-footer a { color: var(--myqr-blue); }


/* ---------------- FOOTER CREDIT (student app) ---------------- */
/* Footer credit line; the version pill borrows currentColor so it inherits
   whichever palette the page uses. */
.myqr-credit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 0 0;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--myqr-muted);
}

.myqr-credit .footer-version {
    padding: 0 8px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0.9;
}

.myqr-credit .footer-version:hover { opacity: 1; }

.myqr-credit .footer-dot { opacity: 0.5; }


/* ---------------- INSTALL GUIDE (register page) ---------------- */
.myqr-install-steps {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.myqr-install-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--myqr-border-soft);
    border-radius: 14px;
    background: var(--myqr-card);
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Circular number badge in the app accent colour. */
.myqr-step-num {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--myqr-blue);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 30px;
    text-align: center;
}

.myqr-step-body {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 30px;
}

.myqr-share-icon { display: inline-flex; color: var(--myqr-blue); }
.myqr-share-icon[hidden] { display: none; }

/* Current step (1-2) is highlighted; 3-4 are queued. */
.myqr-install-step.is-current {
    border-color: var(--myqr-blue);
    background: var(--myqr-tint);
}

.myqr-install-step.is-next .myqr-step-num {
    background: var(--myqr-surface-2);
    color: var(--myqr-muted);
}

/* Installed: steps 1-3 shrink to green checks, step 4 stays actionable. */
.myqr-install-guide.is-installed .myqr-install-step[data-step="1"],
.myqr-install-guide.is-installed .myqr-install-step[data-step="2"],
.myqr-install-guide.is-installed .myqr-install-step[data-step="3"] {
    padding: 6px 10px;
    border-color: transparent;
    background: transparent;
    font-size: 0.8rem;
    color: var(--myqr-muted);
}

.myqr-install-guide.is-installed .myqr-install-step.is-done .myqr-step-num {
    background: var(--myqr-success);
    color: #fff;
}

.myqr-install-guide[hidden] { display: none; }

/* Compact secondary action (install / copy link). */
.myqr-btn-compact {
    display: inline-block;
    width: auto;
    margin-top: 10px;
    padding: 10px 18px;
    font-size: 0.92rem;
}
