/* ==========================================================================
   Proctored Quiz — Elegant Light v2
   Design tokens mirror the HI.SGC moodboard: light grid background, navy
   headings, cyan primary, serif-italic gold accent, Inter body.
   ========================================================================== */

:root {
    --pq-bg:          #FAFAFB;
    --pq-surface:     #ffffff;
    --pq-grid:        #f0f0f0;
    --pq-border:      #e5e7eb;
    --pq-border-soft: #f3f4f6;
    --pq-text:        #0A1428;
    --pq-muted:       #6b7280;
    --pq-muted-2:     #4b5563;
    --pq-body:        #374151;
    --pq-primary:     #0055FF;
    --pq-primary-2:   #0044CC;
    --pq-accent:      #C79D36;
    --pq-danger:      #ef4444;
    --pq-danger-bg:   #fef2f2;
    --pq-danger-bd:   #fecaca;
    --pq-font-sans:   'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --pq-font-serif:  'Playfair Display', Georgia, 'Times New Roman', serif;
    --pq-shadow-sm:   0 2px 8px rgba(15, 23, 42, 0.04);
    --pq-shadow-md:   0 4px 24px rgba(0, 0, 0, 0.02);
    --pq-shadow-lg:   0 18px 48px rgba(15, 23, 42, 0.08);
    --pq-radius:      12px;
    --pq-radius-lg:   16px;
}

/* --------------------------------------------------------------------------
   Host page: suppress theme chrome whenever the quiz shortcode is rendered.
   The `pq-quiz-page` class is injected by the shortcode on DOMContentLoaded.
   -------------------------------------------------------------------------- */
body.pq-quiz-page {
    margin: 0 !important;
    padding: 0 !important;
    background: var(--pq-bg) !important;
}
body.pq-quiz-page .site-header,
body.pq-quiz-page .gcc-header,
body.pq-quiz-page .hi-home-nav,
body.pq-quiz-page .gcc-footer,
body.pq-quiz-page .gcc-scroll-progress,
body.pq-quiz-page #masthead,
body.pq-quiz-page #colophon,
body.pq-quiz-page footer.site-footer,
body.pq-quiz-page header.site-header,
body.pq-quiz-page #wpadminbar,
body.pq-quiz-page .entry-header,
body.pq-quiz-page .page-header,
body.pq-quiz-page .wp-block-template-part[data-type="header"],
body.pq-quiz-page .wp-block-template-part[data-type="footer"] {
    display: none !important;
}
body.pq-quiz-page html,
body.pq-quiz-page body { min-height: 100vh; }
/*
 * Zero out host-theme wrappers so the quiz shell can fill the viewport.
 * IMPORTANT: scope `main` selector to main elements OUTSIDE the quiz app,
 * because `.pq-quiz-main` itself is a <main> tag that needs its own padding.
 */
body.pq-quiz-page > main:not(.pq-quiz-main),
body.pq-quiz-page .gcc-main,
body.pq-quiz-page .site-main,
body.pq-quiz-page .site-content,
body.pq-quiz-page #content,
body.pq-quiz-page #primary,
body.pq-quiz-page article.page,
body.pq-quiz-page .entry-content,
body.pq-quiz-page .entry-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
    background: transparent !important;
}

/* Anti-copy hardening during the quiz itself */
body.pq-exam-mode {
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
body.pq-exam-mode .pq-text-input,
body.pq-exam-mode input,
body.pq-exam-mode textarea {
    user-select: text;
    -webkit-user-select: text;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.pq-app {
    min-height: 100vh;
    width: 100%;
    font-family: var(--pq-font-sans);
    color: var(--pq-text);
    background: var(--pq-bg);
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.pq-app *,
.pq-app *::before,
.pq-app *::after { box-sizing: border-box; }

/* Screens */
.pq-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}
.pq-screen--launch,
.pq-screen--end {
    align-items: center;
    justify-content: center;
    padding: 96px 24px 48px;
    background-image:
        linear-gradient(to right, var(--pq-grid) 1px, transparent 1px),
        linear-gradient(to bottom, var(--pq-grid) 1px, transparent 1px);
    background-size: 40px 40px;
    background-color: var(--pq-bg);
}
.pq-screen--quiz {
    background: var(--pq-surface);
}

/* --------------------------------------------------------------------------
   Brand mark (HI.SGC)
   -------------------------------------------------------------------------- */
.pq-brand-mark {
    position: absolute;
    top: 24px;
    left: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}
@media (min-width: 768px) {
    .pq-brand-mark { top: 32px; left: 32px; }
}
.pq-brand-mark-logo {
    background: var(--pq-primary);
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
    padding: 6px 8px;
    border-radius: 3px;
    letter-spacing: 0.08em;
}
.pq-brand-mark-name {
    font-weight: 700;
    color: var(--pq-text);
    letter-spacing: 0.18em;
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   Card surface (launch + end share this)
   -------------------------------------------------------------------------- */
.pq-card {
    background: var(--pq-surface);
    border: 1px solid var(--pq-border);
    border-radius: var(--pq-radius-lg);
    box-shadow: var(--pq-shadow-md);
    width: 100%;
    max-width: 680px;
    padding: 32px;
}
@media (min-width: 768px) {
    .pq-card { padding: 48px; }
}

/* --------------------------------------------------------------------------
   Launch screen
   -------------------------------------------------------------------------- */
.pq-launch-heading { margin-bottom: 32px; text-align: left; }
.pq-eyebrow {
    font-size: 12px;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 0 0 14px;
}
.pq-launch-title {
    font-family: var(--pq-font-sans);
    font-size: 40px;
    font-weight: 800;
    color: var(--pq-text);
    letter-spacing: -0.02em;
    line-height: 1;
    margin: 0 0 8px;
    transition: opacity 0.35s ease;
}
@media (min-width: 768px) {
    .pq-launch-title { font-size: 48px; }
}
.pq-launch-subtitle {
    font-family: var(--pq-font-serif);
    font-style: italic;
    font-weight: 500;
    color: var(--pq-accent);
    font-size: 30px;
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin: 0;
}
@media (min-width: 768px) {
    .pq-launch-subtitle { font-size: 36px; }
}

.pq-rules { margin-bottom: 32px; }

/* Prevent title flash before quiz data loads */
.pq-app.pq-loading .pq-launch-title,
.pq-app.pq-loading .pq-end-quizname {
    opacity: 0;
}
.pq-rules-label {
    font-size: 12px;
    color: var(--pq-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin: 0 0 12px;
}
.pq-rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.pq-rules-list li {
    display: flex;
    align-items: flex-start;
    color: var(--pq-body);
    padding: 5px 0;
    font-size: 15px;
    line-height: 1.55;
}
.pq-rules-list li::before {
    content: '';
    flex-shrink: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #3b82f6;
    margin: 9px 10px 0 2px;
}
.pq-duration-info {
    margin: 14px 0 0;
    color: var(--pq-muted);
    font-size: 13px;
    font-weight: 500;
}
.pq-duration-info:empty { display: none; }

.pq-launch-form {
    border-top: 1px solid var(--pq-border-soft);
    padding-top: 32px;
}
.pq-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--pq-text);
    margin: 0 0 8px;
}
.pq-launch-form-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
@media (min-width: 768px) {
    .pq-launch-form-row { flex-direction: row; align-items: stretch; }
}

/* --------------------------------------------------------------------------
   Inputs
   -------------------------------------------------------------------------- */
.pq-text-input {
    flex: 1;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--pq-border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--pq-text);
    background: var(--pq-surface);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 46px;
}
.pq-text-input::placeholder { color: #9ca3af; }
.pq-text-input:focus {
    outline: none;
    border-color: var(--pq-primary);
    box-shadow: 0 0 0 3px rgba(0, 85, 255, 0.12);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.pq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    min-height: 46px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    font-family: inherit;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.1s;
    white-space: nowrap;
}
.pq-btn:focus-visible {
    outline: 2px solid var(--pq-primary);
    outline-offset: 2px;
}
.pq-btn--lg { padding: 12px 32px; }

.pq-btn--primary {
    background: var(--pq-primary);
    color: #fff;
}
.pq-btn--primary:hover:not(:disabled) { background: var(--pq-primary-2); }
.pq-btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pq-btn--dark {
    background: var(--pq-text);
    color: #fff;
    padding: 12px 36px;
    box-shadow: 0 4px 12px rgba(10, 20, 40, 0.12);
}
.pq-btn--dark:hover:not(:disabled) { background: #000; }

.pq-btn--ghost {
    background: var(--pq-surface);
    color: var(--pq-muted-2);
    border-color: var(--pq-border);
}
.pq-btn--ghost:hover:not(:disabled) { background: #f9fafb; }
.pq-btn--ghost:disabled {
    opacity: 0;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Quiz screen — sticky header
   -------------------------------------------------------------------------- */
.pq-quiz-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--pq-surface);
    border-bottom: 1px solid var(--pq-border-soft);
    padding: 14px 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}
.pq-quiz-header .pq-brand-mark {
    position: static;
    opacity: 0.55;
    justify-self: start;
}
.pq-quiz-header .pq-brand-mark--muted .pq-brand-mark-logo {
    font-size: 10px;
    padding: 3px 6px;
}
.pq-quiz-header .pq-brand-mark--muted .pq-brand-mark-name {
    font-size: 11px;
    letter-spacing: 0.12em;
}
.pq-question-counter {
    font-size: 12px;
    font-weight: 600;
    color: var(--pq-muted);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    text-align: center;
}
.pq-recording-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--pq-danger);
    background: var(--pq-danger-bg);
    padding: 6px 12px;
    border-radius: 9999px;
    border: 1px solid var(--pq-danger-bd);
    justify-self: end;
    line-height: 1;
}
.pq-recording-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pq-danger);
    animation: pq-pulse 1.5s ease-in-out infinite;
}
@keyframes pq-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* --------------------------------------------------------------------------
   Quiz main content
   -------------------------------------------------------------------------- */
.pq-quiz-main {
    flex: 1 1 auto;
    max-width: 800px;
    width: 100%;
    margin: 0 auto !important;
    padding: 56px 24px 96px !important;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}
@media (min-width: 768px) {
    .pq-quiz-main { padding: 72px 40px 112px !important; }
}
@media (min-width: 1024px) {
    .pq-quiz-main { padding: 88px 48px 128px !important; }
}

/* Timer */
.pq-timer-wrap { margin: 0 0 32px; }
.pq-timer-text {
    font-size: 13px;
    color: var(--pq-muted);
    text-align: right;
    margin: 0 0 8px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.pq-timer-container {
    width: 100%;
    height: 6px;
    background: var(--pq-border-soft);
    border-radius: 3px;
    overflow: hidden;
}
.pq-timer-progress {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, var(--pq-primary));
    width: 100%;
    transition: width 1s linear;
}

/* Question */
.pq-question-text {
    font-size: 22px;
    font-weight: 600;
    color: var(--pq-text);
    line-height: 1.45;
    margin: 0 0 40px !important;
    padding: 0;
    letter-spacing: -0.005em;
}
@media (min-width: 768px) {
    .pq-question-text { font-size: 26px; margin-bottom: 48px !important; }
}

/* Options */
.pq-answer-area { margin: 0 0 56px; padding: 0; }
.pq-options-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.pq-option-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    text-align: left;
    padding: 20px 22px;
    background: var(--pq-surface);
    border: 1px solid var(--pq-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    font-family: inherit;
    color: var(--pq-body);
    font-size: 15px;
    line-height: 1.5;
    position: relative;
}
.pq-option-card:hover {
    border-color: #d1d5db;
    background: rgba(249, 250, 251, 0.6);
}
.pq-option-card.is-selected {
    border-color: var(--pq-primary);
    background: rgba(239, 246, 255, 0.45);
    color: var(--pq-text);
}
.pq-option-card input[type="radio"],
.pq-option-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    inset: 0;
    margin: 0;
}
.pq-option-radio {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 1.5px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    margin-top: 1px;
    transition: border-color 0.2s;
}
.pq-option-radio--square {
    border-radius: 4px;
}
.pq-option-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pq-primary);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
}
.pq-option-radio--square::after { border-radius: 2px; }
.pq-option-card:hover .pq-option-radio { border-color: #9ca3af; }
.pq-option-card.is-selected .pq-option-radio { border-color: var(--pq-primary); }
.pq-option-card.is-selected .pq-option-radio::after { transform: translate(-50%, -50%) scale(1); }
.pq-option-text {
    flex: 1;
    font-size: 15px;
    line-height: 1.55;
}
.pq-option-card.is-selected .pq-option-text {
    font-weight: 500;
}
@media (min-width: 768px) {
    .pq-option-text { font-size: 16px; }
}

/* Text answer input */
.pq-answer-area > .pq-text-input {
    max-width: 640px;
    margin: 0;
}

/* Quiz navigation */
.pq-quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 32px;
    border-top: 1px solid var(--pq-border-soft);
    gap: 12px;
}

/* --------------------------------------------------------------------------
   End screen
   -------------------------------------------------------------------------- */
.pq-card--end {
    max-width: 480px;
    text-align: center;
    padding: 48px 40px;
}
.pq-end-check {
    width: 64px;
    height: 64px;
    background: #eff6ff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #3b82f6;
}
.pq-end-check svg {
    width: 32px;
    height: 32px;
    display: block;
}
.pq-end-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--pq-text);
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}
.pq-end-body {
    color: var(--pq-muted-2);
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.6;
}
.pq-end-username {
    font-weight: 700;
    color: var(--pq-text);
}
.pq-end-quizname {
    font-family: var(--pq-font-serif);
    font-style: italic;
    font-weight: 500;
    color: var(--pq-accent);
    transition: opacity 0.35s ease;
}
.pq-end-violations {
    font-size: 12px;
    color: var(--pq-muted);
    margin: 0 0 16px;
    letter-spacing: 0.04em;
}
.pq-end-violations:empty { display: none; margin: 0; }
.pq-end-home-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--pq-muted);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
    padding: 6px 12px;
}
.pq-end-home-link:hover { color: var(--pq-text); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .pq-screen--launch,
    .pq-screen--end { padding: 80px 16px 32px; }

    .pq-card { padding: 28px 24px; }
    .pq-card--end { padding: 36px 24px; }

    .pq-launch-title    { font-size: 32px; }
    .pq-launch-subtitle { font-size: 22px; }

    .pq-quiz-header {
        padding: 12px 16px;
        grid-template-columns: auto 1fr auto;
        gap: 10px;
    }
    .pq-quiz-header .pq-brand-mark-name { display: none; }
    .pq-question-counter { font-size: 11px; letter-spacing: 0.12em; }

    .pq-quiz-main    { padding: 32px 16px 48px !important; }
    .pq-question-text { font-size: 19px; margin-bottom: 28px !important; }
    .pq-answer-area  { margin-bottom: 36px; }
    .pq-option-card  { padding: 16px; gap: 14px; }

    .pq-quiz-nav .pq-btn { padding: 12px 20px; font-size: 14px; }
}

/* Legacy fallback: hide any leftover overlay node from older builds. */
.pq-fullwindow-overlay {
    position: static !important;
    inset: auto !important;
    background: transparent !important;
    padding: 0 !important;
}
