/* File: assets/css/style.css */
/*
 * ----------------------------------------------------------------
 * SAFETIFY ACADEMY - PUBLIC STYLESHEET
 * ----------------------------------------------------------------
 */

:root {
    --primary-color: #005A9C; /* A strong, professional blue */
    --light-gray: #f4f7f6;
    --border-color: #e5e7eb;
    --dark-gray: #333;
    --error-color: #d90429;
    --success-color: #065f46;
}

/* ----------------------------------
 * Global Reset & Body
 * ---------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background-color: var(--light-gray);
    color: var(--dark-gray);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ----------------------------------
 * Main Form Layout
 * ---------------------------------- */
.container-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.form-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    width: 100%;
    max-width: 600px;
}

.form-card h2 {
    color: var(--primary-color);
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

/* ----------------------------------
 * Form Elements
 * ---------------------------------- */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* Form Input Styles */
.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fff;
    color: var(--dark-gray);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.form-group input[type="file"] {
    width: 100%;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
}
.form-group input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    border: none;
    background: var(--light-gray);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--dark-gray);
    cursor: pointer;
    transition: background-color 0.2s;
}
.form-group input[type="file"]::file-selector-button:hover {
    background: #e9ecef;
}
.form-group input[type="number"] {
    -moz-appearance: textfield;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.1);
}
.form-group textarea {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    min-height: 80px;
}

/* ----------------------------------
 * Buttons & Navigation
 * ---------------------------------- */
.btn {
    display: inline-block;
    width: 100%;
    padding: 0.7rem 1.2rem; /* Reduced padding for compact look */
    font-size: 0.95rem;
    font-weight: 500;
    color: #ffffff;
    background-color: var(--primary-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
    text-decoration: none;
}
.btn:hover {
    background-color: #004a80;
    box-shadow: 0 2px 8px rgba(0, 90, 156, 0.15);
    text-decoration: none;
    transform: translateY(-1px);
}
.btn.secondary {
    background-color: #f4f7f6;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}
.btn.secondary:hover {
    background-color: #e9ecef;
}
.btn.secondary:disabled {
    background-color: var(--light-gray);
    color: #999;
    cursor: not-allowed;
    border-color: var(--border-color);
}
/* Success Button */
.btn.btn-success {
    background-color: var(--success-color);
}
.btn.btn-success:hover {
    background-color: #044e3a;
}

/* Form Navigation (Bottom Bar) */
.form-navigation {
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    gap: 10px; /* Space between buttons */
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.form-navigation .btn {
    width: auto; /* Buttons only take needed space */
    min-width: 120px; /* Minimum clickable area */
    font-size: 0.9rem; /* Slightly smaller for actions */
}

/* ----------------------------------
 * Alerts & Reminders
 * ---------------------------------- */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    border: 1px solid transparent;
}
.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}
.alert-success {
    background-color: #d1fae5;
    color: var(--success-color);
    border-color: #a7f3d0;
}

.pdf-reminder {
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ----------------------------------
 * Section 5: Document List & Checklist
 * ---------------------------------- */
.document-list {
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
}
.document-list li {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    gap: 1rem;
}
.document-list .doc-type {
    font-weight: 600;
    flex-basis: 150px;
    flex-shrink: 0;
    color: var(--primary-color);
}
.document-list .doc-name {
    flex-grow: 1;
    color: #333;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.document-list .doc-actions {
    flex-shrink: 0;
}
.btn-delete {
    color: var(--error-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}
.btn-delete:hover {
    text-decoration: underline;
}

/* Upload Checklist */
.upload-checklist {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.upload-checklist h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
.checklist-note {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1.25rem;
}
.checklist-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.checklist-item {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background-color: #fff;
    transition: all 0.2s ease;
}
.checklist-item .text {
    display: flex;
    flex-direction: column;
    padding-right: 1rem;
}
.checklist-item .text strong {
    font-size: 0.95rem;
    color: var(--dark-gray);
    margin-bottom: 2px;
}
.checklist-item .text span {
    font-size: 0.8rem;
    font-weight: 500;
}
.checklist-item .icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
/* Checklist Status Colors */
.checklist-item.pending {
    border: 1px solid #fcd34d;
    border-left: 5px solid #d90429; /* Red */
    background-color: #fffbeb;
}
.checklist-item.pending .icon { color: #d90429; }
.checklist-item.pending .text span { color: #d90429; }

.checklist-item.completed {
    border: 1px solid #bbf7d0;
    border-left: 5px solid var(--success-color); /* Green */
    background-color: #f0fdf4;
}
.checklist-item.completed .icon { color: var(--success-color); font-weight: bold; }
.checklist-item.completed .text span { color: var(--success-color); }

.checklist-item.optional {
    border: 1px solid #e2e8f0;
    border-left: 5px solid #94a3b8; /* Gray */
    background-color: #f8fafc;
}
.checklist-item.optional .icon { color: #94a3b8; }
.checklist-item.optional .text span { color: #64748b; font-weight: 400; }

/* ----------------------------------
 * Section 6: Policy Tabs
 * ---------------------------------- */
.policy-tabs-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}
.policy-tab-btn {
    flex: 1;
    min-width: 200px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-align: center;
    color: var(--dark-gray);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}
.policy-tab-btn .icon {
    font-size: 2rem;
    background-color: #f0f9ff;
    color: var(--primary-color);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
    transition: transform 0.3s ease;
}
.policy-tab-btn:hover {
    background-color: #ffffff;
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 90, 156, 0.15);
    color: var(--primary-color);
}
.policy-tab-btn:hover .icon {
    transform: scale(1.1);
    background-color: var(--primary-color);
    color: #ffffff;
}
.policy-tab-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 90, 156, 0.1);
}
input[type="checkbox"] { accent-color: var(--primary-color); }

/* ----------------------------------
 * Section 7: Compact Preview Layout
 * ---------------------------------- */
.preview-section {
    margin-bottom: 1.5rem;
    background: #fff;
}
.preview-section:last-of-type {
    margin-bottom: 0;
}

.preview-section h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff; /* White text */
    background-color: var(--primary-color); /* Blue header */
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    font-weight: 700;
    border-radius: 4px 4px 0 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.edit-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    background: #fff;
    padding: 2px 8px;
    border-radius: 2px;
}
.edit-link:hover {
    background: #e2e8f0;
    text-decoration: none;
}

.preview-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0 0.5rem;
}

.data-pair {
    width: 48%; 
    margin-bottom: 0.8rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.data-pair .data-inner {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 2px;
    width: 100%;
}

.data-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 1px;
    font-weight: 700;
    display: block;
}

.data-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: #000;
    line-height: 1.3;
    min-height: 1.3rem;
    display: block;
}

.data-pair.full-width {
    width: 100%;
}

/* Header & Passport Box */
.preview-header-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
}
.preview-header-info {
    flex: 1;
    padding-right: 1rem;
}
.preview-header-info h2 {
    text-align: left;
    margin: 0 0 0.25rem 0;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
}
.preview-header-info p {
    color: #333;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}
.passport-photo-box {
    width: 100px;
    height: 120px;
    border: 1px solid #94a3b8;
    background-color: #f1f5f9;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 2px;
    flex-shrink: 0;
}
.passport-photo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.passport-placeholder {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

/* Graphic Header/Footer (Hidden on Screen) */
.graphic-header, .graphic-footer {
    display: none; 
    width: 100%;
    max-width: 100%;
}
.graphic-header img, .graphic-footer img {
    width: 100%;
    height: auto;
    display: block;
}
.graphic-footer {
    margin-top: 2rem;
}

/* ----------------------------------
 * Status Modal
 * ---------------------------------- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); 
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}
.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    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);
    position: relative;
    animation: slideDown 0.3s;
}
.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}
.close-modal:hover { color: #000; }
.modal-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
}
.modal-body {
    white-space: pre-wrap; 
    font-size: 1.05rem;
    color: #333;
    line-height: 1.7;
}

@keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }
@keyframes slideDown { from {transform: translateY(-20px); opacity: 0;} to {transform: translateY(0); opacity: 1;} }

/* ----------------------------------
 * Responsive & Print Styles
 * ---------------------------------- */
@media (max-width: 600px) {
    .checklist-grid { flex-direction: column; }
    .form-navigation { flex-direction: column; }
    .form-navigation .btn { width: 100%; }
}

@media print {
    body { 
        background-color: #fff; 
        -webkit-print-color-adjust: exact; 
        print-color-adjust: exact; 
        font-size: 11pt; 
    }
    .form-container { padding: 0; max-width: 100%; margin: 0; }
    .form-card { box-shadow: none; border: none; padding: 0; width: 100%; max-width: 100%; margin: 0; }
    
    /* Hide interactive elements */
    .edit-link, .no-print, .btn, .form-navigation, .policy-tabs-container, .pdf-reminder, .modal { 
        display: none !important; 
    }
    
    .preview-section { page-break-inside: avoid; }
    
    /* Force Layout consistency in Print */
    .preview-list { display: flex !important; flex-wrap: wrap !important; justify-content: space-between !important; margin: 0 -0.5rem; }
    .data-pair { width: 48% !important; box-sizing: border-box; page-break-inside: avoid; margin-bottom: 0.5rem; }
    .data-pair.full-width { width: 100% !important; }
    
    /* Show Graphics */
    .graphic-header, .graphic-footer { display: block !important; }
}