/* =============================================================
   SECURITY SURVEY - Custom Stylesheet
   Theme: Dark Cybersecurity Professional
   ============================================================= */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-card-hover: #263148;
    --border-color: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.3);
    --red: #ef4444;
    --blue: #3b82f6;
    --green: #22c55e;
    --amber: #f59e0b;
    --purple: #a855f7;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

.text-muted-custom {
    color: var(--text-secondary) !important;
}

/* =============================================================
   LOGIN PAGE
   ============================================================= */
.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1a1040 50%, #0f172a 100%);
}

.login-container {
    width: 100%;
    max-width: 520px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px 35px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4),
                0 0 80px rgba(56, 189, 248, 0.05);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.3);
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.token-input {
    background: var(--bg-primary) !important;
    border: 2px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-align: center;
    padding: 14px;
    border-radius: 10px;
    transition: all 0.3s;
}

.token-input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

.token-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-control {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.form-control:focus {
    background: var(--bg-primary);
    border-color: var(--accent);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-text {
    color: var(--text-muted);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #6366f1);
    border: none;
    font-weight: 600;
    padding: 12px;
    border-radius: 10px;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.3);
}

.login-footer {
    margin-top: 25px;
}

.info-box {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 10px;
    padding: 15px 20px;
    font-size: 0.85rem;
}

.info-box h6 {
    color: var(--accent);
    margin-bottom: 8px;
}

.info-box ul {
    padding-left: 18px;
    margin-bottom: 0;
}

.info-box li {
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.login-copyright {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-radius: 10px;
}

/* =============================================================
   SURVEY PAGE
   ============================================================= */
.survey-navbar {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
}

.survey-navbar .navbar-brand {
    font-weight: 700;
    color: var(--accent) !important;
}

.survey-progress-container {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.progress {
    background: var(--bg-primary);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--accent), #6366f1);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.survey-container {
    max-width: 800px;
    padding: 30px 15px 120px;
}

/* Survey Steps */
.survey-step {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.survey-step.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Part Header */
.survey-part-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
}

.part-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.survey-part-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.survey-part-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Survey Cards */
.survey-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 25px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.survey-card:hover {
    border-color: rgba(56, 189, 248, 0.3);
}

.instruction-card {
    background: rgba(56, 189, 248, 0.05);
    border-color: rgba(56, 189, 248, 0.15);
}

.instruction-card h5 {
    color: var(--accent);
}

.instruction-card ul {
    color: var(--text-secondary);
}

/* Question Card */
.question-card {
    position: relative;
}

.question-card.answered {
    border-color: rgba(34, 197, 94, 0.4);
}

.question-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.question-number {
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: white;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
}

.question-text {
    font-size: 1.05rem;
    line-height: 1.6;
    font-weight: 500;
    margin-bottom: 18px;
}

/* Option Labels */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s;
    user-select: none;
}

.option-label:hover {
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.05);
}

.option-label.selected {
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.1);
    box-shadow: 0 0 0 1px var(--accent);
}

.option-label.checkbox-selected {
    border-color: var(--green);
    background: rgba(34, 197, 94, 0.1);
    box-shadow: 0 0 0 1px var(--green);
}

.option-input {
    display: none;
}

.option-marker {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.25s;
}

.option-label.selected .option-marker,
.option-label.checkbox-selected .option-marker {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.option-label.checkbox-selected .option-marker {
    background: var(--green);
    border-color: var(--green);
}

.option-text {
    flex: 1;
    line-height: 1.5;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.option-label.selected .option-text,
.option-label.checkbox-selected .option-text {
    color: var(--text-primary);
}

/* Navigation Buttons */
.survey-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    z-index: 200;
}

.btn-nav {
    padding: 10px 28px;
    font-weight: 600;
    border-radius: 10px;
}

.btn-outline-light {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-outline-light:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(34, 197, 94, 0.3);
}

/* Summary */
.summary-info {
    font-size: 0.95rem;
    line-height: 1.8;
}

/* Modal Dark */
.modal-dark {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modal-dark .modal-header {
    border-bottom-color: var(--border-color);
}

.modal-dark .modal-footer {
    border-top-color: var(--border-color);
}

/* =============================================================
   RESULT PAGE
   ============================================================= */
.result-container {
    max-width: 900px;
    padding-top: 35px;
    padding-bottom: 40px;
}

.result-hero {
    background: var(--bg-card);
    border: 2px solid;
    border-radius: 16px;
    padding: 35px;
    margin-bottom: 30px;
    display: flex;
    align-items: flex-start;
    gap: 25px;
}

.result-hero-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    flex-shrink: 0;
}

.result-hero-content {
    flex: 1;
}

.result-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.result-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.result-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.result-secondary {
    margin-top: 10px;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 25px;
}

.result-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Score Bars */
.score-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.score-bar-item {
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s;
}

.score-bar-item.active {
    background: rgba(56, 189, 248, 0.08);
}

.score-bar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.score-letter {
    font-weight: 800;
    font-size: 1.1rem;
    width: 25px;
}

.score-label {
    flex: 1;
    color: var(--text-secondary);
}

.score-value {
    font-weight: 700;
}

.chart-container {
    position: relative;
    max-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Task Items */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 8px;
}

.task-number {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Roadmap Timeline */
.roadmap-timeline {
    position: relative;
    padding-left: 30px;
}

.roadmap-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--border-color);
}

.roadmap-phase {
    position: relative;
    margin-bottom: 25px;
}

.roadmap-phase:last-child {
    margin-bottom: 0;
}

.phase-marker {
    position: absolute;
    left: -25px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid var(--bg-card);
}

.phase-content {
    padding-left: 10px;
}

.phase-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 8px;
}

.phase-items {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-left: 18px;
    margin-bottom: 0;
}

.phase-items li {
    margin-bottom: 4px;
}

/* Certifications */
.certs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cert-badge {
    padding: 8px 16px;
    border: 1px solid;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255,255,255,0.03);
}

/* Experience Lists */
.exp-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.exp-list li {
    padding: 6px 0;
    color: var(--text-secondary);
}

/* Review Answers */
.review-question {
    padding: 10px 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cursor-pointer {
    cursor: pointer;
}

.result-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}

/* =============================================================
   ADMIN PAGE
   ============================================================= */
.page-admin .result-card {
    margin-bottom: 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0;
}

.stat-info small {
    color: var(--text-secondary);
}

.nav-tabs-dark .nav-link {
    color: var(--text-secondary);
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

.nav-tabs-dark .nav-link.active {
    background: var(--bg-card);
    color: var(--accent);
    border: 1px solid var(--border-color);
    border-bottom-color: var(--bg-card);
}

.table-dark {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-secondary);
    --bs-table-border-color: var(--border-color);
    font-size: 0.85rem;
}

.table-dark thead th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.table-dark tbody tr:hover {
    background: rgba(56, 189, 248, 0.05);
}

.token-list-generated {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.token-code {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--accent);
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 768px) {
    .login-card {
        padding: 30px 20px;
    }

    .survey-container {
        padding: 20px 10px 100px;
    }

    .result-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .result-hero-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .result-title {
        font-size: 1.4rem;
    }

    .survey-navigation {
        padding: 10px 15px;
    }

    .btn-nav {
        padding: 8px 18px;
        font-size: 0.9rem;
    }

    .certs-grid {
        flex-direction: column;
    }

    .task-item {
        font-size: 0.85rem;
    }
}

/* =============================================================
   PRINT STYLES
   ============================================================= */
@media print {
    body {
        background: white !important;
        color: #1a1a1a !important;
    }

    .survey-navbar,
    .result-footer,
    .btn {
        display: none !important;
    }

    .result-card,
    .result-hero {
        border: 1px solid #ddd !important;
        break-inside: avoid;
        background: white !important;
    }

    .result-title,
    .card-title,
    .phase-title {
        color: #1a1a1a !important;
    }

    .result-desc,
    .score-label,
    .option-text,
    .phase-items li,
    .task-item {
        color: #333 !important;
    }
}
