/* NASENI Colors */
:root {
    --navy: #1D2764;
    --cyan: #00AEEF;
    --light-bg: #F8FAFC;
    --border: #E2E8F0;
    --text-muted: #64748B;
    --success: #2E9E6B;
    --danger: #D32F2F;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
}

body {
    background: linear-gradient(145deg, #E8EEF8 0%, #D0D9E8 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.portal-container {
    max-width: 1100px;
    width: 100%;
    background: #ffffff;
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(29, 39, 100, 0.25);
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

/* Header */
.portal-header {
    background: var(--navy);
    color: white;
    padding: 1.25rem 2.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 4px solid var(--cyan);
}

/*
.naseni-logo {
    height: 38px;
    width: auto;
    background-color: white;
    padding: 4px 8px;
    border-radius: 6px;
    object-fit: contain;
}*/


.naseni-logo {
    height: 55px;
    width: auto;
    object-fit: contain;
}

.portal-header h1 {
    font-weight: 500;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.portal-header span {
    margin-left: auto;
    font-size: 0.9rem;
    background: rgba(0, 174, 239, 0.2);
    border: 1px solid rgba(0, 174, 239, 0.4);
    padding: 0.4rem 1rem;
    border-radius: 40px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #80D4F8;
}

/* Progress tracker */
.progress-tracker {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 2.5rem 0.5rem;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 60%;
    width: 80%;
    height: 2px;
    background: var(--border);
    z-index: 1;
}

.step.active:not(:last-child)::after {
    background: var(--cyan);
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #94A3B8;
    z-index: 2;
    transition: 0.2s;
}

.step.active .step-circle {
    background: var(--navy);
    border-color: var(--navy);
    color: white;
}

.step.completed .step-circle {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-label {
    font-size: 0.8rem;
    margin-top: 6px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
}

.step.active .step-label {
    color: var(--navy);
    font-weight: 600;
}

/* Main content area */
.stage-content {
    padding: 2rem 2.5rem 2.5rem;
    background: white;
    flex: 1;
    min-height: 400px;
}

.stage {
    display: none;
    animation: fade 0.25s ease;
}

.stage.active {
    display: block;
}

@keyframes fade {
    from { opacity: 0.5; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

h2 i {
    color: var(--cyan);
    font-size: 1.8rem;
}

.subhead {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--cyan);
    padding-left: 1rem;
    font-size: 0.95rem;
}

/* Form Grid Layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 2rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--navy);
    display: block;
    margin-bottom: 0.4rem;
}

.required {
    color: var(--danger);
    margin-left: 2px;
}

/* Read-only Field Styling */
.readonly-input {
    width: 100%;
    padding: 0.85rem 1.2rem;
    border: 1.5px solid var(--border);
    border-radius: 8px; 
    font-size: 0.95rem;
    background: var(--light-bg); 
    color: var(--navy);
    font-weight: 500;
    display: flex;
    align-items: center;
}

.readonly-input i {
    color: var(--success);
    margin-right: 8px;
    font-size: 0.9rem;
}

/* Standard Inputs */
input[type="password"], input[type="text"], input[type="email"], input[type="file"], textarea {
    width: 100%;
    padding: 0.85rem 1.2rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: 0.2s;
    background: var(--light-bg);
    font-family: inherit;
    color: var(--navy);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(0, 174, 239, 0.15);
    background: white;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Password Toggle */
.password-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--navy);
    font-weight: 500;
    user-select: none;
}

.password-toggle i {
    font-size: 1rem;
    color: var(--navy);
}

.password-toggle:hover {
    text-decoration: underline;
    color: var(--cyan);
}

/* Signature Area */
.signature-area {
    background: var(--light-bg);
    border: 2px dashed #CBD5E1;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 0.5rem;
}

.signature-area:hover {
    background: #F0F9FF;
    border-color: var(--cyan);
}

.signature-preview {
    font-family: 'Brush Script MT', 'Segoe UI', cursive;
    font-size: 2.5rem;
    color: var(--navy);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
}

.signature-placeholder {
    color: #94A3B8;
    font-style: italic;
    font-size: 1.1rem;
}

/* Declaration Section */
.declaration-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.declaration-box {
    background: #F0F9FF;
    border-left: 6px solid var(--cyan);
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--navy);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 1.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #475569;
    cursor: pointer;
    line-height: 1.4;
}

.checkbox-item span {
    flex: 1;
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--navy);
    flex-shrink: 0;
}

/* Document Upload List */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 2rem;
}

.doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--light-bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s;
}

.doc-item.error {
    border-color: var(--danger);
    background: #FEF2F2;
}

.doc-item.success {
    border-color: var(--success);
    background: #F0FDF4;
}

.doc-info {
    flex: 1;
    padding-right: 1rem;
}

.doc-title {
    font-weight: 600;
    color: var(--navy);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.doc-file-name {
    font-size: 0.8rem;
    color: var(--success);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-upload {
    background: white;
    border: 1.5px solid #CBD5E1;
    color: var(--navy);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-upload:hover {
    background: #F0F9FF;
    border-color: var(--cyan);
    color: var(--cyan);
}

.btn-upload.has-file {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

/* Optional Custom Uploads */
.custom-upload-section {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1.5px dashed #CBD5E1;
    margin-top: 2rem;
}

.custom-upload-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.custom-upload-row input[type="text"] {
    flex: 1;
}

.custom-upload-row button {
    flex-shrink: 0;
}

/* Buttons */
.btn {
    padding: 0.85rem 2rem;
    border-radius: 40px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
}

.btn-primary {
    background: var(--navy);
    color: white;
    box-shadow: 0 8px 16px -6px rgba(29, 39, 100, 0.4);
}

.btn-primary:hover {
    background: #151D4D;
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -8px var(--navy);
}

.btn-secondary {
    background: white;
    border: 1.5px solid var(--navy);
    color: var(--navy);
}

.btn-secondary:hover {
    background: var(--light-bg);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 8px 16px -6px rgba(46, 158, 107, 0.4);
}

.btn-success:hover {
    background: #217A51;
    transform: translateY(-2px);
}

.btn-danger {
    background: white;
    border: 1.5px solid var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: #FEF2F2;
    transform: translateY(-2px);
}

.btn-print {
    background: var(--cyan);
    color: white;
    box-shadow: 0 8px 16px -6px rgba(0, 174, 239, 0.4);
}

.btn-print:hover {
    background: #0096D6;
    transform: translateY(-2px);
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hidden {
    display: none !important;
}

/* Footer */
.portal-footer {
    background: var(--light-bg);
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
    color: #94A3B8;
    font-size: 0.75rem;
    line-height: 1.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.portal-footer strong {
    color: #64748B;
}
.portal-footer a {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 600;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-muted);
    border: none;
    background: transparent;
    font-size: 1rem;
}
.auth-tab.active {
    background: linear-gradient(90deg, var(--navy), #2a3b68);
    color: white;
    border-radius: 6px;
    margin: 2px;
}

/* Modal for Decline Confirmation */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(29, 39, 100, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(-20px);
    transition: all 0.3s ease;
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--danger);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.modal-body {
    color: #475569;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Admin Dashboard Specific Styles */
.admin-card {
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.admin-card-title {
    color: var(--navy);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}
.admin-card-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/*
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}*/

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Forces exactly 5 columns on one line */
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Keep it responsive for smaller screens (tablets and phones) */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

.stat-card {
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}
.stat-title {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.stat-value {
    color: var(--navy);
    font-size: 2rem;
    font-weight: 700;
}
.admin-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.admin-toolbar input {
    flex: 1;
    min-width: 250px;
}
.table-responsive {
    overflow-x: auto;
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}
th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    background: var(--light-bg);
    color: var(--navy);
    font-weight: 600;
    font-size: 0.9rem;
}
td {
    color: #475569;
    font-size: 0.9rem;
}
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Print styles for the confirmation */
@media print {
    body { background: white; padding: 0; }
    .portal-container { box-shadow: none; border-radius: 0; max-width: 100%; }
    .portal-header, .progress-tracker, .action-buttons, .stage:not(.active), .btn, .modal-overlay, .portal-footer { display: none !important; }
    .stage-content { padding: 0; }
    .print-header { display: block !important; margin-bottom: 20px; text-align: center; }
    .doc-item { border: 1px solid #ccc; background: transparent !important; }
    .btn-upload { display: none !important; }
}

/* mobile */
@media (max-width: 768px) {
    .portal-header { padding: 1rem 1.25rem; flex-wrap: wrap; }
    .portal-header span { margin-left: 0; margin-top: 10px; }
    .progress-tracker { padding: 1rem 0.75rem 0.25rem; }
    .step-label { font-size: 0.65rem; }
    .stage-content { padding: 1.5rem 1.25rem; }
    .form-grid { grid-template-columns: 1fr; }
    .doc-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .btn-upload { width: 100%; justify-content: center; }
    .action-buttons { flex-direction: column-reverse; }
    .btn { width: 100%; }
    .action-group { flex-direction: column; width: 100%; }
    .custom-upload-row { flex-direction: column; align-items: stretch; }
    .checkbox-item { align-items: flex-start; }
    .checkbox-item input[type="checkbox"] { margin-top: 2px; }
    .admin-toolbar { flex-direction: column; }
}
