/**
 * CareerHike Scholarship Test — Frontend Styles
 *
 * Color Scheme: Primary #FF6101 (Orange), Secondary #092A5E (Navy)
 * Font: Inter (Google Fonts)
 *
 * @package CareerHike_Scholarship_Test
 */

/* ===== CSS Variables (defaults — overridden by inline CSS from PHP) ===== */
:root {
    --ch-primary: #FF6101;
    --ch-primary-hover: #E85500;
    --ch-primary-light: rgba(255, 97, 1, 0.08);
    --ch-secondary: #092A5E;
    --ch-secondary-hover: #071F47;
    --ch-secondary-light: rgba(9, 42, 94, 0.08);
    --ch-success: #10B981;
    --ch-danger: #EF4444;
    --ch-warning: #F59E0B;
    --ch-bg: #F8FAFC;
    --ch-card: #FFFFFF;
    --ch-text: #1E293B;
    --ch-text-muted: #64748B;
    --ch-border: #E2E8F0;
    --ch-radius: 12px;
    --ch-radius-sm: 8px;
    --ch-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --ch-shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --ch-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ch-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset ===== */
.ch-scholarship-app,
.ch-scholarship-app * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ch-scholarship-app {
    font-family: var(--ch-font);
    color: var(--ch-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== Step Management ===== */
.ch-step { animation: ch-fadeIn 0.5s ease; }

@keyframes ch-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Notice ===== */
.ch-test-notice {
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: var(--ch-radius);
    padding: 20px;
    text-align: center;
    color: #92400E;
    font-weight: 500;
}

/* =============================================
   REGISTRATION FORM
   ============================================= */

.ch-registration-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.ch-reg-card {
    background: var(--ch-card);
    border-radius: 16px;
    box-shadow: var(--ch-shadow-lg);
    max-width: 535px;
    width: 100%;
    overflow: hidden;
    animation: ch-scaleIn 0.4s ease;
}

@keyframes ch-scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Registration Header */
.ch-reg-header {
    background: linear-gradient(135deg, var(--ch-secondary), var(--ch-secondary-hover));
    padding: 35px 30px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ch-reg-header::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 150%;
    height: 60px;
    background: var(--ch-card);
    border-radius: 50%;
}

.ch-reg-logo {
    max-width: 140px;
    height: auto;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.ch-reg-logo-text {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
}

.ch-reg-title {
    color: var(--ch-primary);
    font-size: 22px;
    font-weight: 800;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

.ch-reg-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    position: relative;
    z-index: 1;
    margin-top: 4px;
}

/* Registration Form */
.ch-reg-form {
    padding: 20px 30px 30px;
}

.ch-reg-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
    background: var(--ch-bg);
    border-radius: var(--ch-radius-sm);
    border: 2px solid transparent;
    transition: var(--ch-transition);
}

.ch-reg-field:focus-within {
    border-color: var(--ch-primary);
    background: var(--ch-primary-light);
    box-shadow: 0 0 0 4px rgba(255, 97, 1, 0.08);
}

.ch-reg-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.ch-reg-input-wrap {
    flex: 1;
}

.ch-reg-input-wrap label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--ch-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.ch-reg-input-wrap input,
.ch-reg-input-wrap select {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 15px;
    font-family: var(--ch-font);
    color: var(--ch-text);
    padding: 4px 0;
    outline: none;
}

.ch-reg-input-wrap select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 20px;
}

.ch-reg-input-wrap input::placeholder {
    color: #CBD5E1;
}

/* Terms */
.ch-reg-terms {
    margin: 16px 0;
    font-size: 13px;
}

.ch-reg-terms label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.ch-reg-terms input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--ch-primary);
}

.ch-terms-link {
    color: var(--ch-primary);
    text-decoration: none;
    font-weight: 600;
}

.ch-terms-content {
    margin-top: 10px;
    padding: 12px;
    background: var(--ch-bg);
    border-radius: var(--ch-radius-sm);
    font-size: 12px;
    color: var(--ch-text-muted);
    max-height: 150px;
    overflow-y: auto;
}

/* Error */
.ch-reg-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--ch-radius-sm);
    padding: 10px 16px;
    color: var(--ch-danger);
    font-size: 13px;
    margin-bottom: 16px;
    animation: ch-shake 0.4s ease;
}

@keyframes ch-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Submit Button */
.ch-reg-submit {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--ch-primary), var(--ch-primary-hover));
    color: #fff;
    border: none;
    border-radius: var(--ch-radius);
    font-size: 16px;
    font-weight: 700;
    font-family: var(--ch-font);
    cursor: pointer;
    transition: var(--ch-transition);
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.ch-reg-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 97, 1, 0.35);
}

.ch-reg-submit:active {
    transform: translateY(0);
}

.ch-reg-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Info Bar */
.ch-reg-info {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--ch-text-muted);
    font-weight: 500;
}

.ch-reg-info-sep { opacity: 0.4; }

/* =============================================
   TEST INTERFACE
   ============================================= */

.ch-test-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Test Header */
.ch-test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--ch-card);
    border-radius: var(--ch-radius);
    box-shadow: var(--ch-shadow);
    margin-bottom: 16px;
}

.ch-test-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ch-test-logo {
    height: 36px;
    width: auto;
}

.ch-test-brand-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--ch-secondary);
}

/* Timer */
.ch-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ch-secondary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: var(--ch-transition);
}

.ch-timer.ch-timer-warning {
    background: var(--ch-warning);
    animation: ch-pulse 1s ease infinite;
}

.ch-timer.ch-timer-danger {
    background: var(--ch-danger);
    animation: ch-pulse 0.5s ease infinite;
}

@keyframes ch-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.ch-timer-icon { font-size: 16px; }

/* Question Info */
.ch-question-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--ch-card);
    border-radius: var(--ch-radius);
    box-shadow: var(--ch-shadow);
    margin-bottom: 8px;
}

.ch-question-counter {
    font-size: 14px;
    color: var(--ch-text-muted);
}

.ch-question-counter strong {
    color: var(--ch-secondary);
    font-size: 16px;
}

.ch-question-subject {
    background: var(--ch-primary-light);
    color: var(--ch-primary);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Progress Bar */
.ch-progress-bar {
    height: 6px;
    background: var(--ch-border);
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.ch-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ch-primary), var(--ch-secondary));
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Question Area */
.ch-question-area {
    background: var(--ch-card);
    border-radius: var(--ch-radius);
    padding: 30px;
    box-shadow: var(--ch-shadow);
    margin-bottom: 16px;
    min-height: 300px;
}

.ch-question-text {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.7;
    color: var(--ch-text);
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--ch-border);
}

/* Option Cards */
.ch-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ch-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--ch-bg);
    border: 2px solid transparent;
    border-radius: var(--ch-radius-sm);
    cursor: pointer;
    transition: var(--ch-transition);
    font-size: 15px;
}

.ch-option:hover {
    border-color: var(--ch-primary);
    background: var(--ch-primary-light);
    transform: translateX(4px);
}

.ch-option.ch-option-selected {
    border-color: var(--ch-primary);
    background: linear-gradient(135deg, var(--ch-primary-light), rgba(255, 97, 1, 0.15));
    box-shadow: 0 2px 8px rgba(255, 97, 1, 0.15);
}

.ch-option-label {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ch-secondary);
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    transition: var(--ch-transition);
}

.ch-option.ch-option-selected .ch-option-label {
    background: var(--ch-primary);
    transform: scale(1.1);
}

.ch-option-text {
    flex: 1;
    color: var(--ch-text);
    font-weight: 400;
}

.ch-option.ch-option-selected .ch-option-text {
    font-weight: 600;
}

/* Question Navigator */
.ch-navigator {
    background: var(--ch-card);
    border-radius: var(--ch-radius);
    padding: 20px;
    box-shadow: var(--ch-shadow);
    margin-bottom: 16px;
}

.ch-nav-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ch-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.ch-nav-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ch-nav-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--ch-border);
    border-radius: 8px;
    background: var(--ch-card);
    color: var(--ch-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ch-transition);
    font-family: var(--ch-font);
}

.ch-nav-btn:hover { border-color: var(--ch-primary); color: var(--ch-primary); }

.ch-nav-btn.ch-nav-current {
    background: var(--ch-secondary);
    border-color: var(--ch-secondary);
    color: #fff;
}

.ch-nav-btn.ch-nav-answered {
    background: var(--ch-success);
    border-color: var(--ch-success);
    color: #fff;
}

.ch-nav-btn.ch-nav-not-answered {
    background: var(--ch-card);
    border-color: var(--ch-border);
    color: var(--ch-text-muted);
}

/* Legend */
.ch-nav-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ch-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ch-text-muted);
}

.ch-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.ch-dot-answered { background: var(--ch-success); }
.ch-dot-not-answered { background: var(--ch-border); }
.ch-dot-current { background: var(--ch-secondary); }

/* Navigation Buttons */
.ch-nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.ch-btn {
    padding: 12px 24px;
    border: 2px solid var(--ch-border);
    border-radius: var(--ch-radius-sm);
    background: var(--ch-card);
    color: var(--ch-text);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--ch-font);
    cursor: pointer;
    transition: var(--ch-transition);
}

.ch-btn:hover { border-color: var(--ch-primary); color: var(--ch-primary); }
.ch-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.ch-btn-prev {}
.ch-btn-next { background: var(--ch-secondary); color: #fff; border-color: var(--ch-secondary); }
.ch-btn-next:hover { background: var(--ch-secondary-hover); }
.ch-btn-clear { font-size: 13px; padding: 8px 16px; }

.ch-btn-primary {
    background: linear-gradient(135deg, var(--ch-primary), var(--ch-primary-hover));
    color: #fff;
    border: none;
    padding: 14px 32px;
    font-size: 15px;
}

.ch-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 97, 1, 0.3);
    color: #fff;
}

/* Submit Area */
.ch-submit-area {
    text-align: center;
    padding: 10px 0 20px;
}

.ch-btn-submit {
    background: linear-gradient(135deg, var(--ch-primary), var(--ch-danger));
    color: #fff;
    border: none;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--ch-radius);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ch-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 97, 1, 0.3);
    color: #fff;
}

/* ===== Overlays ===== */
.ch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: ch-fadeIn 0.3s ease;
}

.ch-overlay-content {
    background: var(--ch-card);
    border-radius: 16px;
    padding: 40px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: var(--ch-shadow-lg);
}

.ch-overlay-icon { font-size: 48px; margin-bottom: 16px; }
.ch-overlay-content h3 { font-size: 20px; color: var(--ch-secondary); margin-bottom: 8px; }
.ch-overlay-content p { color: var(--ch-text-muted); font-size: 14px; margin-bottom: 20px; }

.ch-submit-confirm { text-align: center; }
.ch-modal-btns { display: flex; gap: 12px; justify-content: center; }
.ch-btn-cancel { background: var(--ch-bg); color: var(--ch-text-muted); border: 1px solid var(--ch-border); }

/* =============================================
   RESULT PAGE
   ============================================= */

.ch-result-wrapper {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px;
}

.ch-result-header {
    text-align: center;
    padding: 20px 0;
}

.ch-result-logo {
    max-width: 140px;
    height: auto;
}

/* Status Banner */
.ch-result-status {
    text-align: center;
    padding: 20px;
    border-radius: var(--ch-radius);
    margin-bottom: 24px;
}

.ch-result-status.ch-result-passed {
    background: linear-gradient(135deg, #D1FAE5, #ECFDF5);
}

.ch-result-status.ch-result-failed {
    background: linear-gradient(135deg, #FEE2E2, #FEF2F2);
}

.ch-result-emoji { font-size: 48px; margin-bottom: 8px; }

.ch-result-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0;
}

.ch-result-passed .ch-result-title { color: #065F46; }
.ch-result-failed .ch-result-title { color: #991B1B; }

/* Score Circle */
.ch-score-circle-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.ch-score-circle {
    position: relative;
    width: 160px;
    height: 160px;
}

.ch-score-circle svg {
    width: 100%;
    height: 100%;
}

.ch-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ch-score-percent {
    font-size: 42px;
    font-weight: 900;
    color: var(--ch-primary);
    line-height: 1;
}

.ch-score-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--ch-text-muted);
}

/* Custom Message */
.ch-result-message {
    padding: 16px 20px;
    border-radius: var(--ch-radius-sm);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 24px;
}

.ch-result-message.ch-msg-pass {
    background: #F0FDF4;
    border-left: 4px solid var(--ch-success);
    color: #065F46;
}

.ch-result-message.ch-msg-fail {
    background: #FEF2F2;
    border-left: 4px solid var(--ch-danger);
    color: #991B1B;
}

/* Summary Grid */
.ch-result-summary {
    background: var(--ch-card);
    border-radius: var(--ch-radius);
    padding: 24px;
    box-shadow: var(--ch-shadow);
    margin-bottom: 20px;
}

.ch-result-summary h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ch-secondary);
    margin-bottom: 16px;
}

.ch-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ch-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--ch-bg);
    border-radius: var(--ch-radius-sm);
    font-size: 13px;
}

.ch-summary-label { color: var(--ch-text-muted); font-weight: 500; }
.ch-summary-value { font-weight: 700; color: var(--ch-text); }
.ch-summary-correct { color: var(--ch-success); }
.ch-summary-wrong { color: var(--ch-danger); }
.ch-summary-passed { color: var(--ch-success); font-weight: 700; }
.ch-summary-failed { color: var(--ch-danger); font-weight: 700; }

/* Subject Breakdown */
.ch-result-subjects {
    background: var(--ch-card);
    border-radius: var(--ch-radius);
    padding: 24px;
    box-shadow: var(--ch-shadow);
    margin-bottom: 20px;
}

.ch-result-subjects h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ch-secondary);
    margin-bottom: 16px;
}

.ch-subject-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--ch-border);
}

.ch-subject-row:last-child { border-bottom: none; }

.ch-subject-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--ch-text);
}

.ch-subject-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
}

.ch-subject-stat {
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.ch-stat-correct { background: #D1FAE5; color: #065F46; }
.ch-stat-wrong { background: #FEE2E2; color: #991B1B; }
.ch-stat-skip { background: #FEF3C7; color: #92400E; }

/* Email Notice */
.ch-result-email {
    text-align: center;
    padding: 14px;
    background: var(--ch-primary-light);
    border-radius: var(--ch-radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--ch-primary);
    margin-bottom: 20px;
}

/* Result Actions */
.ch-result-actions {
    text-align: center;
    padding-bottom: 30px;
}

/* Confetti Canvas */
.ch-confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99998;
}

.ch-reg-row {
    display: flex;
    gap: 16px;
}
.ch-reg-row .ch-reg-field {
    flex: 1;
}
@media (max-width: 600px) {
    .ch-reg-row { flex-direction: column; }
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .ch-reg-form { padding: 15px 20px 25px; }
    .ch-reg-header { padding: 25px 20px; }
    .ch-question-area { padding: 20px; }
    .ch-test-header { flex-direction: column; gap: 12px; }
    .ch-nav-buttons { flex-wrap: wrap; }
    .ch-nav-buttons .ch-btn { flex: 1; min-width: 100px; text-align: center; }
    .ch-summary-grid { grid-template-columns: 1fr; }
    .ch-question-info { flex-direction: column; gap: 8px; text-align: center; }
}
