* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #a1afc4;
    --border: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* Premium User Enhancements */
.premium-welcome {
    text-align: center;
    margin-bottom: 3rem;
}

.welcome-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.progress-circle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 3rem 0;
}

.progress-ring {
    position: relative;
    width: 200px;
    height: 200px;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    fill: none;
    stroke: var(--border);
    stroke-width: 12;
}

.progress-ring-progress {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.progress-ring-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-percentage {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.progress-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.progress-stat {
    text-align: center;
}

.progress-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.progress-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Mistakes Review Section */
.mistakes-dashboard {
    margin: 2rem 0;
}

.mistakes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.mistakes-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.chapter-weakness-chart {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.mistakes-list {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--border);
    max-height: 400px;
    overflow-y: auto;
}

.mistake-item {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--danger);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mistake-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.mistake-question {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.mistake-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.mistake-chapter {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    font-size: 0.875rem;
}

.premium-badge {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Main Layout */
.main-container {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.25rem 1rem;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 70px;
    bottom: 0;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.nav-item {
    padding: 0.625rem 0.875rem;
    border-radius: 10px;
    margin-bottom: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

/* Content Area */
.content {
    margin-left: 280px;
    flex: 1;
    padding: 1.25rem 2rem;
    max-width: 1800px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 2rem;
    max-width: 960px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    text-align: left;
    transition: all 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.feature-title {
    font-weight: 600;
    margin-bottom: 0.4375rem;
    font-size: 1rem;
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    font-weight: 700;
}

.btn-gold:hover:not(:disabled) {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(251, 191, 36, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
}

.btn-google {
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    font-weight: 500;
    font-size: 0.9375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-google:hover:not(:disabled) {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
}

[data-theme="dark"] .btn-google {
    background: #131314;
    color: #e3e3e3;
    border-color: #5f6368;
}

[data-theme="dark"] .btn-google:hover:not(:disabled) {
    background: #222428;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Quiz Interface */
.quiz-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1rem;
    height: calc(100vh - 140px);
}

.quiz-main {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    position: relative;
}

.quiz-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.progress-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.progress-header {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    margin-bottom: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-bar-container {
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
}

.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
    transition: transform 0.2s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    transition: color 0.3s ease;
}

.stat-label {
    font-size: 0.625rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.3125rem;
}

.question-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1.125rem;
    border-bottom: 2px solid var(--border);
}

.question-number {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--primary);
}

.question-meta {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.report-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.report-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.report-btn:active {
    transform: scale(0.95);
}

.question-text {
    font-size: 1.4375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.75rem;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
    padding-right: 80px;
}

.option {
    padding: 1.125rem 1.375rem;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.0625rem;
    position: relative;
    line-height: 1.6;
    font-weight: 500;
}

.option:hover:not(.locked) {
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.option.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.option.correct {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.option.incorrect {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.option.locked {
    cursor: not-allowed;
}

.feedback-box {
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1.125rem;
    font-weight: 500;
    display: none;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.feedback-box.correct {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success);
    color: var(--success);
}

.feedback-box.incorrect {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger);
    color: var(--danger);
}

.quiz-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1.25rem;
}

/* Floating Next Button */
.floating-next {
    position: absolute;
    right: -70px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    z-index: 10;
}

.floating-next:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-xl);
}

.floating-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--text-tertiary);
}

.floating-next.answered {
    animation: pulse 0.5s ease;
}

@keyframes pulse {

    0%,
    100% {
        transform: translateY(-50%) scale(1);
    }

    50% {
        transform: translateY(-50%) scale(1.15);
    }
}

/* Results Page */
.results-container {
    max-width: 1600px;
    margin: 0 auto;
}

.results-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.results-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.score-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.score-card {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border);
}

.score-card-value {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.375rem;
}

.score-card-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    min-height: 260px;
    display: flex;
    flex-direction: column;
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.chart-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 0.875rem;
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.review-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.review-item {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--danger);
}

.review-question {
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.review-answers {
    display: flex;
    flex-direction: column;
    gap: 0.4375rem;
    font-size: 0.8125rem;
}

.review-correct {
    color: var(--success);
}

.review-incorrect {
    color: var(--danger);
}

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem auto;
    max-width: 1300px;
    align-items: center;
    justify-items: center;
}

.pricing-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 1.75rem 1.5rem;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 100%;
    max-width: 400px;
}

.pricing-card.featured {
    border-color: var(--success);
    transform: scale(1.08);
    box-shadow: var(--shadow-xl);
    z-index: 2;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.pricing-card.featured {
    border-color: var(--primary);
    transform: scale(1.05);
}

.best-value {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 0.375rem 1rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-lg);
}

.pricing-name {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 0.625rem;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0.625rem 0 0.5rem;
}

.pricing-price small {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.pricing-total {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1.125rem;
    font-weight: 500;
    padding: 0.3125rem 0.875rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: inline-block;
}

.pricing-features {
    list-style: none;
    margin: 1.125rem 0 1.375rem;
    text-align: left;
    width: 100%;
}

.pricing-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-features li::before {
    content: "✓";
    color: var(--success);
    font-weight: bold;
    margin-right: 0.75rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    position: relative;
}

.auth-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: fadeIn 0.3s ease;
}

.auth-loading-overlay.active {
    display: flex;
}

/* Modern Single Gradient Spinner - CLEAN & MINIMAL */
.auth-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 2rem;
}

.auth-spinner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--primary);
    animation: cleanSpin 1s linear infinite;
}

@keyframes cleanSpin {
    to {
        transform: rotate(360deg);
    }
}

.modal h2 {
    margin-bottom: 1.5rem;
    font-size: 1.875rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1.125rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: none;
}

/* Notification */
.notification {
    position: fixed;
    top: 90px;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-xl);
    z-index: 3000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading */
.loading-spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Large screens (32" monitors, ultrawide) */
@media (min-width: 1920px) {
    .content {
        padding: 2rem 3rem;
    }

    .hero {
        max-width: 1100px;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .feature-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .results-container {
        max-width: 1800px;
    }

    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }

    .pricing-grid {
        max-width: 1500px;
        gap: 2rem;
    }

    .pricing-card {
        max-width: 440px;
    }

    .quiz-layout {
        grid-template-columns: 1fr 320px;
    }

    .question-text {
        font-size: 1.625rem;
    }

    .stats-overview-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
        padding: 1rem;
    }

    .quiz-layout {
        grid-template-columns: 1fr;
    }

    .quiz-sidebar {
        order: -1;
        flex-direction: row;
        gap: 0.75rem;
        overflow-x: auto;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .quiz-sidebar .progress-card,
    .quiz-sidebar .stat-box {
        flex-shrink: 0;
        min-width: 160px;
    }

    .floating-next {
        display: none;
    }

    .options-container {
        padding-right: 0;
    }

    .stats-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 0.75rem;
        height: 60px;
    }

    .main-container {
        margin-top: 60px;
        min-height: calc(100vh - 60px);
    }

    .sidebar {
        top: 60px;
    }

    .logo {
        font-size: 1.125rem;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .user-badge {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .btn-secondary#authBtn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .welcome-text {
        font-size: 1.5rem;
    }

    .progress-ring {
        width: 160px;
        height: 160px;
    }

    .progress-ring svg {
        width: 160px;
        height: 160px;
    }

    .progress-ring-circle,
    .progress-ring-progress {
        cx: 80;
        cy: 80;
        r: 74;
    }

    .progress-percentage {
        font-size: 2rem;
    }

    .progress-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .quiz-main {
        padding: 1rem;
        border-radius: 14px;
    }

    .question-header {
        margin-bottom: 1.25rem;
        padding-bottom: 0.875rem;
    }

    .question-text {
        font-size: 1.0625rem;
        margin-bottom: 1.25rem;
        line-height: 1.5;
    }

    .option {
        font-size: 0.9375rem;
        padding: 0.875rem 1rem;
        border-radius: 10px;
        -webkit-tap-highlight-color: transparent;
    }

    .options-container {
        gap: 0.625rem;
    }

    .feedback-box {
        font-size: 0.875rem;
        padding: 0.875rem;
    }

    .quiz-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-top: 1rem;
    }

    .quiz-controls .btn {
        flex: 1;
        min-width: 0;
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
    }

    .stats-overview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .score-card {
        padding: 1rem;
    }

    .score-card-value {
        font-size: 1.875rem;
    }

    .score-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        padding: 0 0.5rem;
    }

    .pricing-card {
        max-width: 100%;
    }

    .pricing-card.featured {
        transform: scale(1);
        order: -1;
    }

    .form-input {
        font-size: 16px;
        padding: 0.875rem;
    }

    .modal {
        padding: 1.5rem;
        width: 95%;
        border-radius: 16px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .form-group {
        margin-bottom: 1.25rem;
    }

    .mistake-item {
        font-size: 0.875rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        padding: 1.25rem;
    }

    .mistakes-header {
        flex-direction: column;
        gap: 1rem;
    }

    .mistakes-header div {
        flex-direction: column;
        width: 100%;
    }

    .mistakes-header .btn {
        width: 100%;
    }

    .auth-spinner {
        width: 50px;
        height: 50px;
    }

    .auth-loading-text {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .review-question {
        font-size: 0.9375rem;
    }

    .review-answers {
        font-size: 0.8125rem;
    }

    .notification {
        right: 1rem;
        left: 1rem;
        width: auto;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 0.5rem;
    }

    .content {
        padding: 0.75rem;
    }

    .hero {
        padding: 0.75rem;
    }

    .hero h1 {
        font-size: 1.375rem;
    }

    .hero-subtitle {
        font-size: 0.9375rem;
    }

    .welcome-text {
        font-size: 1.25rem;
    }

    .progress-ring {
        width: 140px;
        height: 140px;
    }

    .progress-ring svg {
        width: 140px;
        height: 140px;
    }

    .progress-percentage {
        font-size: 1.75rem;
    }

    .question-text {
        font-size: 1rem;
    }

    .option {
        font-size: 0.875rem;
        padding: 0.75rem 0.875rem;
    }

    .quiz-main {
        padding: 0.875rem;
        border-radius: 12px;
    }

    .quiz-controls {
        gap: 0.375rem;
    }

    .quiz-controls .btn {
        font-size: 0.8125rem;
        padding: 0.625rem 0.5rem;
    }

    .chart-card {
        min-height: 220px;
    }

    .stats-overview-grid {
        grid-template-columns: 1fr;
    }

    .score-summary {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 1.25rem;
        width: 100%;
        border-radius: 12px 12px 0 0;
        max-height: 85vh;
    }

    .pricing-card {
        padding: 1.25rem 1rem;
    }

    .pricing-name {
        font-size: 1.25rem;
    }

    .pricing-price {
        font-size: 2rem;
    }
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

.hidden {
    display: none !important;
}

/* Profile Section */
.profile-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.profile-card-header {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.profile-field-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Invoice Items */
.invoice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
}

.invoice-item-info {
    flex: 1;
}

.invoice-item-plan {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.invoice-item-date {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.invoice-item-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-right: 1rem;
}

/* Invoice Print Layout */
.invoice-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.invoice-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.invoice-header h2 {
    font-size: 1.75rem;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.invoice-party h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.invoice-party p {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.invoice-table th {
    text-align: left;
    padding: 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    border-bottom: 2px solid var(--border);
}

.invoice-table td {
    padding: 0.75rem;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.invoice-table .invoice-total-row td {
    font-weight: 700;
    font-size: 1.0625rem;
    border-top: 2px solid var(--border);
    border-bottom: none;
    padding-top: 1rem;
}

.invoice-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.subscription-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.subscription-status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.subscription-status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.subscription-status-badge.expired {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.subscription-status-badge.none {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

/* Print styles for invoice */
@media print {
    body * {
        visibility: hidden;
    }

    #invoiceModal,
    #invoiceModal .modal,
    #invoiceModal .modal *,
    #invoiceContent,
    #invoiceContent * {
        visibility: visible;
    }

    #invoiceModal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white !important;
    }

    #invoiceModal .modal {
        max-width: 100%;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        padding: 2rem;
    }

    .invoice-actions {
        display: none !important;
    }

    .invoice-content {
        color: #000 !important;
    }

    .invoice-content * {
        color: #000 !important;
    }

    .invoice-table th {
        color: #666 !important;
    }

    .invoice-footer {
        color: #999 !important;
    }
}

@media (max-width: 768px) {
    .profile-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .invoice-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .invoice-item-amount {
        margin-right: 0;
    }

    .invoice-parties {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Footer Styles - Minimal & Clean */
.footer {
    margin-left: 280px;
    padding: 0;
    margin-top: 6rem;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(to right,
            transparent 0%,
            var(--border) 20%,
            var(--border) 80%,
            transparent 100%);
    margin-bottom: 2rem;
}

.footer-content {
    padding: 0 2rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-separator {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.footer-copyright {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .footer {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .footer {
        margin-top: 4rem;
    }

    .footer-content {
        padding: 0 1rem 1.5rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-separator {
        display: none;
    }
}

/* ============================================
   NAV ITEM BUTTON RESET
   ============================================ */
button.nav-item {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* ============================================
   FOCUS VISIBLE STYLES
   ============================================ */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25);
}

.option:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.form-input:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.nav-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    border-radius: 10px;
}

.theme-toggle:focus-visible,
.mobile-menu-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.pricing-card:focus-within {
    border-color: var(--primary);
}

/* ============================================
   TESTIMONIALS
   ============================================ */
.testimonials-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
}

.testimonial-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
}

.testimonial-stars {
    color: #fbbf24;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.1em;
}

.testimonial-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.testimonial-author strong {
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.testimonial-author span {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

/* ============================================
   FAQ SECTION
   ============================================ */
.faq-section {
    margin-top: 3rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.faq-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.faq-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-item[open] {
    border-color: var(--primary);
}

.faq-question {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: "+";
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 1rem;
}

.faq-item[open] .faq-question::after {
    content: "\2212";
}

.faq-answer {
    padding: 0 1.25rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* ============================================
   FREE TRIAL BANNER
   ============================================ */
.free-trial-banner {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.free-trial-banner a {
    color: #f59e0b;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.free-trial-banner a:hover {
    text-decoration: underline;
}

/* ============================================
   EXAM TIMER
   ============================================ */
.exam-timer {
    background: var(--bg-secondary);
    border: 2px solid var(--warning);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.exam-timer.warning {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    animation: timerPulse 1s ease infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.timer-icon {
    font-size: 1.125rem;
}

.timer-display {
    font-variant-numeric: tabular-nums;
}

/* ============================================
   STUDY STREAKS & BADGES
   ============================================ */
.streak-display {
    margin-top: 0.75rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
}

.streak-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f59e0b;
    line-height: 1;
}

.streak-value::before {
    content: "\01F525 ";
}

.streak-label {
    font-size: 0.625rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.badge.earned {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(129, 140, 248, 0.1));
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary);
}

.badge-icon {
    font-size: 0.875rem;
}

/* ============================================
   DOMAIN RECOMMENDATIONS (Results Page)
   ============================================ */
.domain-recommendations {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.domain-rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.domain-rec-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.domain-rec-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.domain-rec-accuracy {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.domain-rec-accuracy.low { color: var(--danger); }
.domain-rec-accuracy.medium { color: var(--warning); }
.domain-rec-accuracy.high { color: var(--success); }

.domain-rec-name {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.domain-rec-action {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   RESPONSIVE ADDITIONS
   ============================================ */
@media (max-width: 768px) {
    .testimonials-section {
        grid-template-columns: 1fr;
    }

    .free-trial-banner {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .exam-timer {
        justify-content: center;
    }

    .domain-rec-grid {
        grid-template-columns: 1fr;
    }
}