* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Roboto Slab', Georgia, serif;
    background: #f5f7fa;
    color: #1a1a2e;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
.header-title, .btn, .badge, .module-order, .back-link,
.user-name, .progress-label, .login-note,
.track-card-title, .track-card-desc, .track-card-status {
    font-family: 'Roboto Condensed', Arial, Helvetica, sans-serif;
}

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* Header */
.header {
    background: #303030;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
}
.header-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 16px;
}
.logo { height: 28px; }
.header-title {
    color: #11B1C3;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.user-info { display: flex; align-items: center; gap: 12px; }
.user-name { color: #a0a0b8; font-size: 14px; }

/* Main */
.main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Loading */
.loading { text-align: center; padding: 80px 0; color: #666; }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #11B1C3;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
}
.login-card {
    background: white;
    border-radius: 4px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    max-width: 440px;
    width: 100%;
}
.login-logo { height: 36px; margin-bottom: 24px; }
.login-card h1 { font-size: 24px; margin-bottom: 8px; color: #1a1a2e; }
.login-subtitle { color: #666; margin-bottom: 32px; }
.login-note { font-size: 12px; color: #999; margin-top: 16px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    background: #11B1C3;
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn:hover { background: #0C828F; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: #e0e0e0; color: #333; }
.btn-secondary:hover { background: #d0d0d0; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-google { background: #4285f4; }
.btn-google:hover { background: #3367d6; }

/* Dashboard */
.dashboard h1 { margin-bottom: 24px; }

/* Track Overview Cards */
.track-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 48px;
}
@media (max-width: 700px) {
    .track-overview { grid-template-columns: 1fr; }
}
.track-card {
    background: white;
    border-radius: 4px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s, box-shadow 0.15s;
    border-left: 4px solid #e0e0e0;
    overflow: hidden;
}
.track-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.track-card.track-awareness { border-left-color: #11B1C3; }
.track-card.track-secure-coding { border-left-color: #DC8245; }
.track-card-link {
    display: block;
    padding: 24px 28px;
    text-decoration: none;
    color: inherit;
    flex: 1;
}
.track-card-actions {
    padding: 0 28px 20px;
    display: flex;
    gap: 10px;
}
.track-card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}
.track-card-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 0;
}
.track-card-progress {
    margin-bottom: 16px;
}
.track-card-progress .progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}
.track-card-progress .progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}
.track-awareness .track-card-progress .progress-fill {
    background: #11B1C3;
}
.track-secure-coding .track-card-progress .progress-fill {
    background: #DC8245;
}
.track-card-status {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px 20px;
}
.track-card-status .badge { font-size: 11px; }
.track-card-cert {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0a8a5a;
    font-weight: 700;
    font-size: 13px;
}
.track-card-cert-link {
    text-decoration: none;
}
.badge.badge-active { color: white; }
.track-awareness .badge-active { background: #11B1C3; }
.track-secure-coding .badge-active { background: #DC8245; }

/* Track Page */
.track-page { max-width: 1200px; }
.track-page-desc {
    font-size: 15px;
    color: #666;
    margin-bottom: 24px;
}

/* Progress Bar */
.progress-section { margin-bottom: 16px; }
.progress-label { font-size: 14px; color: #666; margin-bottom: 8px; }
.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #11B1C3, #DC8245);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Cert Banner */
.cert-banner {
    background: linear-gradient(135deg, #11B1C3 0%, #0C828F 100%);
    color: white;
    border-radius: 4px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.cert-banner-icon {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.cert-banner p { margin: 4px 0 0; opacity: 0.9; font-size: 14px; }
.cert-banner .btn { background: rgba(255,255,255,0.2); margin-left: auto; }
.cert-banner .btn:hover { background: rgba(255,255,255,0.3); }

/* Module Cards */
.module-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.module-card {
    background: white;
    border-radius: 4px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.15s, box-shadow 0.15s;
    display: block;
}
.module-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.module-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.module-order {
    width: 32px; height: 32px;
    background: #f0f0f5;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #11B1C3;
    font-size: 14px;
}
.module-card h3 { font-size: 17px; margin-bottom: 6px; }
.module-desc { font-size: 14px; color: #666; }

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-complete { background: #e6f7f0; color: #0a8a5a; }
.badge-perfect { background: #11B1C3; color: white; }
.badge-retry { background: #fff3e0; color: #e65100; }
.badge-new { background: #f0f0f5; color: #666; }
.track-card-top {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 16px;
}
.track-card-info { flex: 1; }
.track-card-mandatory {
    font-family: 'Roboto Condensed', Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.track-awareness .track-card-mandatory { color: #11B1C3; }
.track-secure-coding .track-card-mandatory { color: #DC8245; }
.track-card-pct {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f0f0f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto Condensed', Arial, Helvetica, sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.track-awareness .track-card-pct { background: #11B1C3; }
.track-secure-coding .track-card-pct { background: #DC8245; }
.track-card-pct.pct-zero { background: #d0d0d0; }

/* Module Page */
.module-page { max-width: 800px; }
.back-link { color: #11B1C3; text-decoration: none; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.back-link:hover { text-decoration: underline; }
.module-header { margin-bottom: 32px; }
.module-header h1 { margin-top: 12px; }
.module-content {
    background: white;
    border-radius: 4px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}
.module-actions { display: flex; align-items: center; gap: 16px; }
.already-passed { display: flex; align-items: center; gap: 16px; color: #0a8a5a; font-weight: 500; }

/* Markdown */
.markdown h2 { font-size: 22px; margin: 24px 0 12px; color: #1a1a2e; }
.markdown h3 { font-size: 18px; margin: 20px 0 8px; color: #333; }
.markdown h4 { font-size: 16px; margin: 16px 0 6px; color: #444; }
.markdown h5 { font-size: 15px; margin: 14px 0 6px; color: #555; }
.markdown p { margin: 8px 0; color: #444; }
.markdown li { margin: 4px 0 4px 24px; color: #444; }
.markdown li.md-numbered { list-style-type: decimal; }
.markdown strong { color: #1a1a2e; }
.markdown code.md-code {
    background: #f0f0f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9em;
    color: #d44c42;
}
.markdown br { display: block; content: ""; margin: 4px 0; }

/* Quiz */
.quiz-page { max-width: 800px; }
.quiz-page h1 { margin: 12px 0 32px; }
.quiz-questions { margin-bottom: 32px; }
.quiz-question { margin-bottom: 28px; }
.quiz-question h3 { margin-bottom: 12px; font-size: 16px; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 15px;
}
.quiz-option:hover { border-color: #11B1C3; background: #f8fffe; }
.quiz-option.selected { border-color: #11B1C3; background: #e8f8f8; }
.radio {
    width: 20px; height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.selected .radio { border-color: #11B1C3; }
.radio-dot {
    width: 10px; height: 10px;
    background: #11B1C3;
    border-radius: 50%;
}

/* Quiz Result */
.quiz-result { display: flex; justify-content: center; padding: 40px 0; }
.result-card {
    background: white;
    border-radius: 4px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    max-width: 480px;
    width: 100%;
}
.result-card.passed { border-top: 4px solid #0a8a5a; }
.result-card.failed { border-top: 4px solid #D44C42; }
.result-score {
    font-size: 64px;
    font-weight: 700;
    margin: 16px 0;
}
.passed .result-score { color: #0a8a5a; }
.failed .result-score { color: #D44C42; }
.result-card p { color: #666; margin-bottom: 24px; }
.result-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }

.cert-earned {
    background: linear-gradient(135deg, #11B1C3 0%, #0C828F 100%);
    color: white;
    border-radius: 4px;
    padding: 24px;
    margin: 24px 0;
}
.cert-earned h3 { margin-bottom: 4px; }
.cert-earned p { color: rgba(255,255,255,0.9); margin-bottom: 16px; }
.cert-earned .btn { background: rgba(255,255,255,0.2); }

/* Certificate Page */
.certificate-page { max-width: 800px; margin: 0 auto; }
.certificate {
    background: white;
    border: 3px solid #11B1C3;
    border-radius: 4px;
    padding: 48px;
    margin-top: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.cert-header { text-align: center; margin-bottom: 32px; }
.cert-logo { height: 40px; margin-bottom: 16px; }
.cert-header h1 { color: #11B1C3; font-size: 20px; margin-bottom: 4px; }
.cert-header h2 { font-weight: normal; color: #666; font-size: 18px; }
.cert-body { text-align: center; padding: 24px 0; }
.cert-certifies { font-size: 16px; color: #666; }
.cert-name { color: #11B1C3; font-size: 28px; margin: 8px 0; }
.cert-email { color: #999; font-size: 14px; margin-bottom: 16px; }
.cert-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
    color: #666;
}

.error { text-align: center; padding: 40px; color: #D44C42; }
.error h2 { margin-bottom: 8px; }
.error .btn { margin-top: 16px; }
