/* ORCH Quiz – Frontend Styles v1.2.0 */

/* ------------------------------------------------------------------ */
/*  CSS Custom Properties (overridden inline by PHP via shortcode)      */
/* ------------------------------------------------------------------ */

#orch-quiz-app {
    --oq-primary:      #c9a96e;
    --oq-text:         #1a1a2e;
    --oq-card-bg:      #ffffff;
    --oq-btn-text:     #ffffff;
    --oq-dark:         #1a1a2e;
    --oq-border:       #e0e0e0;
    --oq-radius:       12px;
    --oq-shadow:       0 4px 32px rgba(0,0,0,.10);
    --oq-error:        #e74c3c;
    --oq-muted:        #777;
    --oq-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* Intro screen – overridden by PHP inline vars */
    --oq-intro-bg:     #102b74;
    --oq-intro-title:  #ffffff;
    --oq-intro-text:   #ffffff;
}

/* ------------------------------------------------------------------ */
/*  Container                                                           */
/* ------------------------------------------------------------------ */

#orch-quiz-app,
#orch-quiz-app .orch-quiz-container {
    max-width: 620px;
    margin: 0 auto;
    font-family: var(--oq-font);
    color: var(--oq-text);
}

#orch-quiz-app .oq-form-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
    letter-spacing: -.5px;
}

/* ------------------------------------------------------------------ */
/*  Progress                                                            */
/* ------------------------------------------------------------------ */

#orch-quiz-app .oq-progress-wrap {
    margin-bottom: 24px;
}
#orch-quiz-app .oq-progress-bar {
    height: 6px;
    background: var(--oq-border);
    border-radius: 99px;
    overflow: hidden;
}
#orch-quiz-app .oq-progress-fill {
    height: 100%;
    background: var(--oq-primary);
    border-radius: 99px;
    transition: width .4s ease;
    width: 0%;
}
#orch-quiz-app .oq-progress-label {
    text-align: right;
    font-size: .78rem;
    color: var(--oq-muted);
    margin-top: 6px;
}

/* ------------------------------------------------------------------ */
/*  Intro Screen                                                        */
/* ------------------------------------------------------------------ */

#orch-quiz-app .oq-intro-screen {
    background: #102b74;
    border-radius: var(--oq-radius);
    padding: 56px 0px 52px;
/*     box-shadow: var(--oq-shadow); */
}

@media (max-width: 540px) {
    #orch-quiz-app .oq-intro-screen { padding: 36px 24px 32px; }
}

#orch-quiz-app .oq-intro-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--oq-intro-title) !important;
    text-transform: uppercase;
    letter-spacing: .5px;
    line-height: 1.2;
    margin: 0 0 20px;
}

@media (max-width: 540px) {
    #orch-quiz-app .oq-intro-title { font-size: 1.5rem; }
}

#orch-quiz-app .oq-intro-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--oq-intro-text) !important;
    margin: 0 0 16px;
    line-height: 1.5;
}

#orch-quiz-app .oq-intro-body {
    font-size: .95rem;
    color: var(--oq-intro-text) !important;
    opacity: .85;
    margin: 0 0 36px;
    line-height: 1.7;
}

#orch-quiz-app .oq-btn-intro {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: auto;
    padding: 14px 32px;
    background: transparent;
    color: var(--oq-intro-title) !important;
    border: 2px solid var(--oq-intro-title);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: background .2s, color .2s;
    box-shadow: none;
}
#orch-quiz-app .oq-btn-intro:hover {
    background: var(--oq-intro-title);
    color: var(--oq-intro-bg) !important;
    transform: none;
}
#orch-quiz-app .oq-intro-arrow {
    font-size: 1.1rem;
}

/* ------------------------------------------------------------------ */
/*  Step card                                                           */
/* ------------------------------------------------------------------ */

#orch-quiz-app .oq-step {
    background: var(--oq-card-bg);
    border: 1px solid var(--oq-border);
    border-radius: var(--oq-radius);
    box-shadow: var(--oq-shadow);
    overflow: hidden;
}

#orch-quiz-app .oq-step-inner {
    padding: 36px 40px 32px;
}

@media (max-width: 540px) {
    #orch-quiz-app .oq-step-inner { padding: 24px 20px 20px; }
}

#orch-quiz-app .oq-step-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--oq-text) !important;
    margin: 0 0 24px;
    line-height: 1.4;
}

/* ------------------------------------------------------------------ */
/*  Contact fields  (high-specificity to beat theme overrides)         */
/* ------------------------------------------------------------------ */

#orch-quiz-app .oq-field-wrap {
    margin-bottom: 18px;
}
#orch-quiz-app .oq-field-wrap label,
#orch-quiz-app .oq-field-wrap label * {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    color: var(--oq-text) !important;
    margin-bottom: 6px;
    background: transparent !important;
}
#orch-quiz-app .oq-required {
    color: var(--oq-primary) !important;
    display: inline !important;
}

#orch-quiz-app .oq-field {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--oq-border);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--oq-text);
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    outline: none;
}
#orch-quiz-app .oq-field:focus {
    border-color: var(--oq-primary);
    box-shadow: 0 0 0 3px rgba(201,169,110,.18);
    background: #fff;
}
#orch-quiz-app .oq-field.oq-field-invalid {
    border-color: var(--oq-error);
    box-shadow: 0 0 0 3px rgba(231,76,60,.12);
}

#orch-quiz-app .oq-field-error {
    font-size: .8rem;
    color: var(--oq-error);
    margin-top: 4px;
    min-height: 16px;
}

/* ------------------------------------------------------------------ */
/*  Answer cards                                                        */
/* ------------------------------------------------------------------ */

#orch-quiz-app .oq-answers-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

#orch-quiz-app .oq-answer-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 2px solid var(--oq-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .15s;
    background: #fafafa;
    user-select: none;
    position: relative;
}
#orch-quiz-app .oq-answer-card:hover {
    border-color: var(--oq-primary);
    background: #fffdf7;
    transform: translateX(3px);
}
#orch-quiz-app .oq-answer-card.selected {
    border-color: var(--oq-primary);
    background: #fffdf7;
    box-shadow: 0 0 0 3px rgba(201,169,110,.18);
}
#orch-quiz-app .oq-answer-card.selected .oq-answer-marker {
    background: var(--oq-primary);
    border-color: var(--oq-primary);
}
#orch-quiz-app .oq-answer-card.selected .oq-answer-marker::after {
    opacity: 1;
    transform: scale(1);
}

/* Hide native radio */
#orch-quiz-app .oq-answer-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom radio marker */
#orch-quiz-app .oq-answer-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--oq-border);
    flex-shrink: 0;
    position: relative;
    transition: background .2s, border-color .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#orch-quiz-app .oq-answer-marker::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    transform: scale(0);
    transition: opacity .2s, transform .2s;
}

#orch-quiz-app .oq-answer-label {
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--oq-text) !important;
}

/* ------------------------------------------------------------------ */
/*  Buttons                                                             */
/* ------------------------------------------------------------------ */

#orch-quiz-app .oq-btn {
    display: inline-block;
    width: 100%;
    padding: 14px 28px;
    background: var(--oq-primary);
    color: var(--oq-btn-text, #fff) !important;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: .3px;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 16px rgba(201,169,110,.35);
    text-align: center;
}
#orch-quiz-app .oq-btn:hover:not(:disabled) {
    background: #b8914f;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(201,169,110,.45);
}
#orch-quiz-app .oq-btn:active:not(:disabled) {
    transform: translateY(0);
}
#orch-quiz-app .oq-btn.oq-btn-disabled,
#orch-quiz-app .oq-btn:disabled {
    background: #d0d0d0;
    color: #999 !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#orch-quiz-app .oq-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--oq-muted);
    font-size: .85rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
    transition: color .2s;
}
#orch-quiz-app .oq-btn-back:hover { color: var(--oq-primary); }

/* ------------------------------------------------------------------ */
/*  Skeleton loader (server-rendered, shown until JS hydrates)          */
/* ------------------------------------------------------------------ */

#orch-quiz-app .oq-skeleton {
    background: var(--oq-card-bg);
    border-radius: var(--oq-radius);
    padding: 56px 40px;
    box-shadow: var(--oq-shadow);
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
@media (max-width: 540px) {
    #orch-quiz-app .oq-skeleton { padding: 40px 24px; min-height: 240px; }
}

#orch-quiz-app .oq-skeleton-spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid rgba(0,0,0,.08);
    border-top-color: var(--oq-primary);
    animation: oq-skeleton-spin .8s linear infinite;
    margin-bottom: 8px;
}

#orch-quiz-app .oq-skeleton-line {
    width: 100%;
    max-width: 420px;
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, #ececec 0%, #f6f6f6 50%, #ececec 100%);
    background-size: 200% 100%;
    animation: oq-skeleton-shimmer 1.4s ease-in-out infinite;
}
#orch-quiz-app .oq-skeleton-line--title {
    height: 20px;
    max-width: 80%;
}
#orch-quiz-app .oq-skeleton-line--short {
    max-width: 50%;
}

@keyframes oq-skeleton-spin {
    to { transform: rotate(360deg); }
}
@keyframes oq-skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ------------------------------------------------------------------ */
/*  reCAPTCHA                                                           */
/* ------------------------------------------------------------------ */

#orch-quiz-app #oq-recaptcha-widget { margin-bottom: 16px; }

/* ------------------------------------------------------------------ */
/*  End screen                                                          */
/* ------------------------------------------------------------------ */

#orch-quiz-app .oq-end-screen .oq-step-inner {
    text-align: center;
    padding: 48px 40px;
}
#orch-quiz-app .oq-end-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: oqPop .5s cubic-bezier(.36,1.56,.64,1) forwards;
}
@keyframes oqPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

#orch-quiz-app .oq-end-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--oq-text) !important;
    margin: 0 0 12px;
}
#orch-quiz-app .oq-end-message {
    font-size: 1rem;
    color: var(--oq-muted);
    line-height: 1.6;
    margin: 0;
}

#orch-quiz-app .oq-redirecting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(0, 0, 0, .06);
    animation: oqRedirectFadeIn .25s ease forwards;
}
#orch-quiz-app .oq-redirecting-spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, .08);
    border-top-color: var(--oq-primary);
    animation: oq-skeleton-spin .7s linear infinite;
    flex-shrink: 0;
}
#orch-quiz-app .oq-redirecting-text {
    margin: 0;
    font-size: .95rem;
    color: var(--oq-muted);
    font-weight: 500;
}
@keyframes oqRedirectFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

#orch-quiz-app .oq-end-qualified    { border-top: 4px solid #27ae60; }
#orch-quiz-app .oq-end-disqualified { border-top: 4px solid var(--oq-primary); }
