:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --card-bg: #ffffff;
    --border-color: rgba(45, 156, 140, 0.15);
    --accent-teal: #2D9C8C;
    --accent-teal-hover: #248275;
    --accent-gold: #F9C01C;
    --text-primary: #0f172a;
    --text-muted: #475569;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Header style for registration page */
.reg-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.reg-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

/* Wizard Steps Indicator */
.steps-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.steps-line {
    position: absolute;
    top: 25px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: #e2e8f0;
    z-index: 1;
}

.steps-progress {
    position: absolute;
    top: 25px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: var(--accent-teal);
    z-index: 1;
    width: 0%;
    transition: width 0.4s ease;
}

.step-item {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 80px;
}

.step-num {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #e2e8f0;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    transition: all 0.3s ease;
}

.step-item.active .step-num {
    border-color: var(--accent-teal);
    background: var(--accent-teal);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(45, 156, 140, 0.4);
}

.step-item.completed .step-num {
    border-color: var(--accent-teal);
    background: #ffffff;
    color: var(--accent-teal);
}

.step-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.step-item.active .step-label {
    color: var(--accent-teal);
}

/* Form Container */
.form-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    max-width: 950px;
    margin: 0 auto 50px;
    overflow: hidden;
}

.form-step-content {
    display: none;
    padding: 40px;
}

.form-step-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.section-title {
    color: var(--accent-teal);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 25px;
    font-weight: 700;
}

/* Custom input styling */
.form-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-control, .form-select {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(45, 156, 140, 0.15);
    outline: none;
}

/* Table layout for form styling similar to PDF */
.pdf-table-grid {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.pdf-table-grid td, .pdf-table-grid th {
    border: 1px solid #cbd5e1;
    padding: 12px;
    vertical-align: middle;
}

.pdf-table-grid th {
    background-color: #f1f5f9;
    font-weight: 700;
}

/* Signature Pad container */
.sig-container {
    border: 2px dashed var(--accent-teal);
    border-radius: 12px;
    background: #f8fafc;
    position: relative;
    margin-top: 15px;
    margin-bottom: 10px;
}

.sig-canvas {
    width: 100%;
    height: 180px;
    cursor: crosshair;
    display: block;
}

.sig-clear-btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 10;
}

/* Navigation buttons */
.button-row {
    background: #f8fafc;
    padding: 20px 40px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.btn-teal {
    background: var(--accent-teal);
    color: #ffffff;
    font-weight: 700;
    border: none;
    transition: all 0.3s ease;
}

.btn-teal:hover {
    background: var(--accent-teal-hover);
    color: #ffffff;
}

.btn-gold {
    background: var(--accent-gold);
    color: #0f172a;
    font-weight: 700;
    border: none;
    transition: all 0.3s ease;
}

.btn-gold:hover {
    background: #e0a800;
    color: #0f172a;
}

/* Agreement Layout for Display on web */
.agreement-content {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 30px;
    max-height: 500px;
    overflow-y: scroll;
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 25px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

/* Print/Official Document replication styles (A4 paper simulation for review/printing) */
.official-doc-page {
    background: #ffffff;
    width: 210mm;
    min-height: 297mm;
    padding: 20mm;
    margin: 20px auto;
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
    position: relative;
    color: #000000;
    font-family: 'Cairo', 'Times New Roman', serif;
}

.official-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px double #000000;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.official-logo-box {
    text-align: center;
    flex: 1;
}

.official-logo-box img {
    height: 70px;
    object-fit: contain;
}

.official-header-side {
    width: 200px;
    font-size: 0.75rem;
}

.official-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 20px 0;
    text-decoration: underline;
}

.official-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.official-table th, .official-table td {
    border: 1px solid #000000 !important;
    padding: 6px 10px;
    text-align: center;
    vertical-align: middle;
}

.official-table th {
    background-color: #f2f2f2 !important;
    font-weight: bold;
}

.official-table.text-right-cells td {
    text-align: right;
}

.page-break {
    page-break-before: always;
}

/* Staff status bar at the top of review page */
.staff-control-bar {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 15px 25px;
    max-width: 210mm;
    margin: 20px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

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

.status-pending { background: #fef3c7; color: #d97706; }
.status-approved { background: #dcfce7; color: #15803d; }

/* Printing styling */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .staff-control-bar, .button-row, header, footer, .reg-header {
        display: none !important;
    }
    
    .official-doc-page {
        width: 100% !important;
        margin: 0 !important;
        padding: 10mm 15mm !important;
        box-shadow: none !important;
        page-break-after: always;
        min-height: auto !important;
    }
    
    .official-doc-page:last-child {
        page-break-after: avoid;
    }
    
    @page {
        size: A4 portrait;
        margin: 0;
    }
}

/* Explicit validation styling overrides */
.form-control.is-invalid, .form-select.is-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.form-group.text-danger .form-label {
    color: #ef4444 !important;
    font-weight: 700;
}

.form-label.required::after {
    content: " *";
    color: #ef4444;
}
