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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f8fafc;
    min-height: 100vh;
    color: #1e293b;
}

.page {
    display: none;
    min-height: 100vh;
    background-color: #f8fafc;
    padding: 2rem 1rem;
}

.page.active {
    display: block;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    min-height: calc(100vh - 4rem);
}

.container.wide {
    max-width: 900px;
}

.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    width: 100%;
}

.card-header {
    padding: 1.5rem 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.card-header .header-with-icon {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.header-with-icon.space-between {
    justify-content: space-between;
}

.icon-wrapper {
    padding: 0.75rem;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-wrapper.purple {
    background: #f3f0ff;
}

.icon-wrapper.indigo {
    background: #eef2ff;
}

.icon-wrapper.blue {
    background: #eff6ff;
}

.icon-wrapper.success {
    background: #f0fdf4;
}

.icon-wrapper.warning {
    background: #fffbeb;
}

.icon {
    width: 2rem;
    height: 2rem;
    color: #475569;
}

.icon-wrapper.purple .icon {
    color: #7c3aed;
}

.icon-wrapper.indigo .icon {
    color: #4f46e5;
}

.icon-wrapper.blue .icon {
    color: #2563eb;
}

.icon-wrapper.success .icon {
    color: #059669;
}

.icon-wrapper.warning .icon {
    color: #d97706;
}

.icon-small {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

.icon-small.success {
    color: #059669;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.card-title.small {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.card-description {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 400;
}

.card-content {
    padding: 0 2rem 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-outline {
    background: white;
    color: #64748b;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-large {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.toggle-auth {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.toggle-auth a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

.toggle-auth a:hover {
    text-decoration: underline;
}

.scroll-area {
    height: 16rem;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    background: #f9fafb;
    margin-bottom: 1.5rem;
}

.nda-content h3 {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.nda-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.nda-content p {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #374151;
}

.nda-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.nda-content li {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.25rem;
}

.nda-content .highlight {
    font-weight: 600;
    margin-top: 1rem;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label {
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.signature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

#signatureCanvas {
    width: 100%;
    max-width: 600px;
    height: 150px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: white;
    cursor: crosshair;
    display: block;
}

.help-text {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: #4f46e5;
    transition: width 0.3s ease;
}

.flex-1 {
    flex: 1;
}

.question-text {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #111827;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.option:hover {
    background: #f9fafb;
}

.option input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    flex-shrink: 0;
}

.option label {
    flex: 1;
    cursor: pointer;
    font-size: 0.875rem;
}

.score-display {
    margin-bottom: 2rem;
}

.score-display > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
}

.score-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4f46e5;
}

.review-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.review-item {
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid;
}

.review-item.correct {
    border-color: #86efac;
    background: #f0fdf4;
}

.review-item.incorrect {
    border-color: #fca5a5;
    background: #fef2f2;
}

.review-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.review-header svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.review-item.correct svg {
    color: #059669;
}

.review-item.incorrect svg {
    color: #dc2626;
}

.review-question {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.review-answer {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.review-correct {
    font-size: 0.875rem;
    color: #047857;
    font-weight: 500;
    margin-top: 0.25rem;
}

.review-explanation {
    font-size: 0.875rem;
    font-style: italic;
    color: #374151;
    margin-top: 0.5rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.page-title {
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: #64748b;
    margin-top: 0.25rem;
    font-weight: 400;
}

.success-banner {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-banner {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-banner h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.25rem;
}

.status-banner p {
    font-size: 0.875rem;
    color: #b45309;
}

.success-banner h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #065f46;
    margin-bottom: 0.25rem;
}

.success-banner p {
    font-size: 0.875rem;
    color: #047857;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

.info-item {
    margin-bottom: 1rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.value {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
}

.badge.success {
    background: #dcfce7;
    color: #166534;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #3b82f6;
}

.border-top {
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.checklist {
    list-style: none;
}

.checklist li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.checklist li:before {
    content: "✓";
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background: #d1fae5;
    color: #059669;
    border-radius: 50%;
    text-align: center;
    font-size: 0.75rem;
    line-height: 1rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #111827;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(150%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
}

.toast.error {
    background: #dc2626;
}

.toast.success {
    background: #059669;
}

.training-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.training-actions .btn-outline {
    flex-shrink: 0;
}

/* NDA Modal Styles */
.nda-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}

.nda-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 800px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.nda-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.nda-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.nda-modal-content {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.nda-info {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.nda-info p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

.nda-info strong {
    color: #065f46;
}

.nda-signature-section {
    margin-bottom: 1.5rem;
}

.nda-signature-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #111827;
}

.signature-image {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    max-width: 100%;
    height: auto;
    display: block;
}

.nda-document-preview {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
}

.nda-document-preview h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #111827;
}

.nda-summary {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
}

.nda-summary p {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #374151;
}

.nda-summary ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.nda-summary li {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    color: #374151;
}

/* Admin Page Styles */
.admin-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-btn:hover {
    color: #1e293b;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.admin-table-container {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.admin-table th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
}

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

.admin-table tr:hover {
    background: #f8fafc;
}

.btn-view {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-view:hover {
    background: #dbeafe;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.passed {
    background: #dcfce7;
    color: #166534;
}

.status-badge.failed {
    background: #fef2f2;
    color: #dc2626;
}

.status-badge.pending {
    background: #f1f5f9;
    color: #475569;
}

@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .admin-nav {
        width: 100%;
        justify-content: space-between;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .training-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .training-actions .btn {
        width: 100%;
    }
    
    .nda-modal-overlay {
        padding: 1rem;
    }
    
    .nda-modal-header {
        padding: 1rem 1.5rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .nda-modal-content {
        padding: 1.5rem;
    }
}
