/* =========================================================================
   Design Variables — Dr. Kapil Amgain Theme (doctorkapil.com.np)
   ========================================================================= */
:root {
    --primary:       #149797;
    --primary-hover: #0a5f5f;
    --primary-dark:  #0f2a2a;
    --accent:        #11d4d4;
    --success:       #10b981;
    --success-bg:    #ecfdf5;
    --danger:        #ef4444;
    --danger-bg:     #fef2f2;
    --text:          #102222;
    --text-muted:    #6b7280;
    --bg:            #f6f8f8;
    --card-bg:       #ffffff;
    --border:        rgba(226, 232, 240, 0.8);
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.05);
    --shadow-md:     0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg:     0 16px 48px rgba(0,0,0,0.10);
    --radius:        16px;
    --transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================================
   Global Reset
   ========================================================================= */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =========================================================================
   Screen Transitions
   ========================================================================= */
.app-wrapper { min-height: 100vh; }

.screen { display: none; }

.screen.active {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    animation: fadeUp 0.5s ease forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   START SCREEN — Header
   ========================================================================= */
.site-header {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226,232,240,0.5);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon-wrap {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 18px;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Times New Roman', Times, serif;
}

.header-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    background: rgba(17, 212, 212, 0.1);
    border: 1px solid rgba(17, 212, 212, 0.3);
    border-radius: 20px;
    color: var(--primary-hover);
    font-size: 0.82rem;
    font-weight: 600;
}

/* =========================================================================
   START SCREEN — Hero
   ========================================================================= */
.hero-section {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 32px;
    display: grid;
    grid-template-columns: 1.2fr 0.9fr;
    gap: 80px;
    align-items: center;
}

/* --- Left Column --- */
.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(17, 212, 212, 0.1);
    border: 1px solid rgba(17, 212, 212, 0.3);
    border-radius: 20px;
    color: var(--primary-hover);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: 20px;
}

.hero-accent {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 36px;
    max-width: 500px;
}

/* Stats Row */
.stats-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    width: fit-content;
    box-shadow: var(--shadow-sm);
}

.stat-item { display: flex; flex-direction: column; align-items: center; }

.stat-num {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
}

/* Feature Pills */
.feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.pill i { color: var(--primary); }

/* --- Right Column: Login Card --- */
.login-card {
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.login-card-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 36px 36px 28px;
    text-align: center;
    color: #fff;
}

.login-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    border: 2px solid rgba(255,255,255,0.3);
}

.login-card-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.login-card-header p {
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    margin: 0;
}

.login-form {
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-form label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    display: block;
}

.optional-tag {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 13px 16px 13px 40px;
    font-size: 0.95rem;
    border: 1px solid rgba(17, 212, 212, 0.25);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--text);
    transition: var(--transition);
    outline: none;
    font-family: 'Inter', sans-serif;
    appearance: none;
    cursor: pointer;
}

.input-group select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 16px top 50%;
    background-size: 12px auto;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(17, 212, 212, 0.12);
}

.start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 6px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.start-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.6s ease;
}

.start-btn:hover:not(:disabled)::before { left: 100%; }

.start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(20, 151, 151, 0.4);
}

.start-btn:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 32px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.login-card-footer i { color: var(--primary); }

/* =========================================================================
   START SCREEN — Footer
   ========================================================================= */
.site-footer {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: rgba(255,255,255,0.8);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
}

.site-footer a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    transition: color 0.2s;
}

.site-footer a:hover { color: var(--accent); }

/* =========================================================================
   QUIZ SCREEN
   ========================================================================= */
.quiz-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.quiz-card {
    width: 100%;
    max-width: 680px;
    text-align: left;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.badge {
    padding: 6px 14px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.badge.outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}

#question-text {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 25px;
    line-height: 1.5;
    color: var(--text);
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 35px;
}

.option {
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    background: #fff;
    display: flex;
    align-items: center;
}

.option:hover {
    border-color: rgba(17,212,212,0.5);
    background: rgba(17,212,212,0.03);
    transform: translateX(4px);
}

.option.selected {
    border-color: var(--primary);
    background: rgba(20,151,151,0.06);
    color: var(--primary-hover);
    box-shadow: 0 0 0 2px rgba(20,151,151,0.1);
}

/* =========================================================================
   Buttons (shared)
   ========================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    width: 100%;
    box-shadow: 0 4px 12px rgba(20,151,151,0.25);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20,151,151,0.35);
}

.primary-btn:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
}

.outline-btn {
    background: transparent;
    color: var(--primary-hover);
    border: 2px solid var(--primary);
}

.outline-btn:hover { background: rgba(20,151,151,0.05); }

.action-btn {
    background: linear-gradient(135deg, var(--primary-dark), #000);
    color: #fff;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15,42,42,0.4);
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-direction: column;
    margin-top: 20px;
}

/* =========================================================================
   RESULT SCREEN
   ========================================================================= */
.result-card {
    width: 100%;
    max-width: 700px;
    text-align: center;
}

.result-card h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 4px;
}

.result-card h1::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    margin: 12px auto 0;
}

.result-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-hover);
    margin-bottom: 4px;
}

/* Email Status Banner */
.email-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 12px 0 0;
}

.email-status.hidden { display: none; }

.email-status.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #6ee7b7;
}

.email-status.error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fca5a5;
}

.score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 35px 0;
}

.score-circle {
    width: 140px; height: 140px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0%, #e2e8f0 0%);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px;
    transition: background 1.2s ease-in-out;
}

.score-circle-inner {
    width: 116px; height: 116px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
}

#score-percentage {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-hover);
}

#score-text { font-size: 1.15rem; font-weight: 700; color: var(--text); }

/* =========================================================================
   Review Section
   ========================================================================= */
.review-section {
    text-align: left;
    margin-top: 36px;
    border-top: 1px solid var(--border);
    padding-top: 28px;
    margin-bottom: 10px;
}

.review-section h3 {
    margin-bottom: 20px;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 800;
}

.review-item {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-left: 5px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.review-item.correct { border-left-color: var(--success); background: var(--success-bg); }
.review-item.wrong   { border-left-color: var(--danger);  background: var(--danger-bg); }

.review-question { font-weight: 700; margin-bottom: 10px; font-size: 0.95rem; line-height: 1.5; color: var(--text); }

.review-answer { font-size: 0.9rem; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.review-answer span.label { font-weight: 700; color: var(--text-muted); min-width: 120px; }
.review-answer.correct-text { color: var(--success); }
.review-answer.wrong-text   { color: var(--danger); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
    .hero-section {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 40px 24px;
    }
    .hero-title { font-size: 2rem; }
    .hero-subtitle { max-width: 100%; }
}

@media (max-width: 600px) {
    .site-header { padding: 0 20px; }
    .header-badge { display: none; }
    .login-card-header { padding: 28px 24px 22px; }
    .login-form { padding: 22px 24px; }
    .login-card-footer { padding: 12px 24px; }
    .site-footer { flex-direction: column; gap: 10px; text-align: center; padding: 20px; }
    .stats-row { width: 100%; justify-content: center; }
    .card { padding: 28px 22px; }
}

/* =========================================================================
   ADMIN PANEL STYLES
   ========================================================================= */
.admin-body {
    align-items: flex-start;
    padding: 0;
    display: block;
}

.admin-header {
    background: #ffffff;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-container {
    padding: 32px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.data-table th, .data-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.data-table th {
    background: #f8fafc;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: #f1f5f9;
    cursor: pointer;
}

.score-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.score-badge.high { background: var(--success-bg); color: var(--success); }
.score-badge.medium { background: #fffbeb; color: #d97706; }
.score-badge.low { background: var(--danger-bg); color: var(--danger); }

/* --- Admin Modal --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { 
    font-size: 1.4rem; 
    font-weight: 800; 
    color: var(--primary-dark);
}

.close-modal {
    background: none; 
    border: none; 
    font-size: 1.5rem; 
    color: var(--text-muted); 
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}
