/* =============================================================================
   Catholic Diocese of Chipata — Site Styles
   ============================================================================= */

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

body {
    font-family: Georgia, 'Times New Roman', serif;
    background: #ece9e2;
    color: #2c2c2c;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.site-header {
    background: linear-gradient(135deg, #1a3a6e 0%, #2a5298 100%);
    color: #fff;
    padding: 16px 30px;
    border-bottom: 4px solid #c8a951;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    max-width: 1100px;
    margin: 0 auto;
}

.logo {
    height: 86px;
    width: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.45));
}

.header-text h1 {
    font-size: 1.85rem;
    letter-spacing: 0.4px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.35);
    line-height: 1.2;
}

.header-subtitle {
    font-size: 0.95rem;
    opacity: 0.82;
    margin-top: 5px;
    font-style: italic;
}

/* ── Navigation ───────────────────────────────────────────────────────────── */

.main-nav {
    background: #12295a;
    border-bottom: 2px solid #c8a951;
}

.main-nav ul {
    list-style: none;
    display: flex;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 30px;
}

.main-nav ul li a {
    display: block;
    padding: 10px 20px;
    color: #ddd8c0;
    text-decoration: none;
    font-family: Arial, sans-serif;
    font-size: 0.88rem;
    letter-spacing: 0.5px;
    transition: background 0.2s, color 0.2s;
}

.main-nav ul li a:hover {
    background: #c8a951;
    color: #12295a;
}

/* ── Main content areas ───────────────────────────────────────────────────── */

.login-main,
.upload-main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 30px;
}

/* ── Under construction notice ────────────────────────────────────────────── */

.under-construction {
    background: #fff8e8;
    border: 2px solid #e8c84a;
    border-radius: 8px;
    padding: 22px 32px;
    text-align: center;
    margin-bottom: 36px;
}

.uc-label {
    font-size: 1.15rem;
    font-weight: bold;
    color: #8a6000;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.under-construction p {
    color: #6b4c00;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ── Login card ───────────────────────────────────────────────────────────── */

.login-box {
    background: #fff;
    border: 1px solid #ccc4a8;
    border-radius: 8px;
    padding: 32px 40px;
    max-width: 380px;
    margin: 0 auto;
    box-shadow: 0 4px 18px rgba(26,58,110,0.13);
}

.login-box h3 {
    color: #1a3a6e;
    font-size: 1.15rem;
    text-align: center;
    padding-bottom: 14px;
    margin-bottom: 22px;
    border-bottom: 2px solid #c8a951;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.84rem;
    color: #555;
    font-family: Arial, sans-serif;
}

.form-group input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #bbb09a;
    border-radius: 4px;
    font-size: 0.95rem;
    background: #fafaf7;
    font-family: Arial, sans-serif;
    transition: border-color 0.2s, background 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #2a5298;
    background: #fff;
}

.error-msg {
    color: #c0392b;
    background: #fdf0ee;
    border: 1px solid #e8a89c;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.85rem;
    margin-bottom: 14px;
    font-family: Arial, sans-serif;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn-primary {
    background: #1a3a6e;
    color: #fff;
    border: none;
    padding: 10px 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.93rem;
    font-family: Arial, sans-serif;
    letter-spacing: 0.3px;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
    background: #2a5298;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    background: #8fa4c0;
    cursor: not-allowed;
}

.login-box .btn-primary {
    width: 100%;
    padding: 11px;
    font-size: 1rem;
    margin-top: 6px;
}

/* ── Flash messages ───────────────────────────────────────────────────────── */

.flash {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
}

.flash-ok {
    background: #e8f5e9;
    border: 1px solid #81c784;
    color: #1b5e20;
}

.flash-error {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #b71c1c;
}

/* ── Upload sections ──────────────────────────────────────────────────────── */

.upload-section {
    background: #fff;
    border: 1px solid #ccc4a8;
    border-radius: 8px;
    padding: 28px 32px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(26,58,110,0.08);
}

.upload-section h2 {
    color: #1a3a6e;
    font-size: 1.15rem;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 2px solid #c8a951;
}

.hint {
    color: #666;
    font-size: 0.84rem;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin-bottom: 18px;
}

/* ── Three-column listbox row ─────────────────────────────────────────────── */

.listbox-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.listbox-col {
    flex: 1;
    min-width: 175px;
}

.listbox-col > label {
    display: block;
    font-family: Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #1a3a6e;
    margin-bottom: 5px;
}

.listbox-col select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #bbb09a;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 0.88rem;
    background: #fafaf7;
    cursor: pointer;
    transition: border-color 0.2s;
}

.listbox-col select:not(:disabled) {
    border-color: #2a5298;
    background: #fff;
}

.listbox-col select:disabled {
    background: #ece9e2;
    color: #999;
    cursor: default;
}

/* ── Destination preview ──────────────────────────────────────────────────── */

.destination-preview {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.84rem;
    background: #f0ede8;
    border: 1px solid #ccc4a8;
    border-radius: 4px;
    padding: 8px 14px;
    margin-bottom: 20px;
    color: #666;
}

.destination-preview span {
    color: #1a3a6e;
    font-weight: bold;
}

/* ── File input row ───────────────────────────────────────────────────────── */

.file-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.file-label {
    font-family: Arial, sans-serif;
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
}

.file-input {
    flex: 1;
    min-width: 200px;
    font-family: Arial, sans-serif;
    font-size: 0.88rem;
    padding: 6px 8px;
    border: 1px solid #bbb09a;
    border-radius: 4px;
    background: #fafaf7;
}

/* ── Other-files section (slightly differentiated) ────────────────────────── */

.upload-other {
    border-color: #a8bdd0;
    background: #f5f8fb;
}

.upload-other h2 {
    color: #2a5298;
    border-bottom-color: #7aacce;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
    background: #12295a;
    color: #b8cce0;
    text-align: center;
    padding: 14px 30px;
    font-size: 0.78rem;
    font-family: Arial, sans-serif;
    border-top: 3px solid #c8a951;
    margin-top: auto;
}

/* ── Listbox action buttons (Add / Delete) ────────────────────────────────── */

.lb-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.btn-lb {
    flex: 1;
    padding: 5px 6px;
    font-size: 0.78rem;
    font-family: Arial, sans-serif;
    font-weight: bold;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.18s, opacity 0.18s;
    letter-spacing: 0.2px;
}

.btn-lb:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.btn-lb-add {
    background: #2e7d32;
    color: #fff;
}

.btn-lb-add:hover:not(:disabled) {
    background: #388e3c;
}

.btn-lb-del {
    background: #b71c1c;
    color: #fff;
}

.btn-lb-del:hover:not(:disabled) {
    background: #c62828;
}

.btn-lb-edit {
    background: #1565c0;
    color: #fff;
}

.btn-lb-edit:hover:not(:disabled) {
    background: #1976d2;
}

/* ── Required Sections panel ──────────────────────────────────────────────── */

.sections-panel {
    background: #f7f5f0;
    border: 1px solid #ccc4a8;
    border-radius: 6px;
    padding: 16px 20px 14px;
    margin-bottom: 20px;
}

.sections-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.sections-header h3 {
    font-size: 0.95rem;
    color: #1a3a6e;
    font-family: Arial, sans-serif;
    font-weight: bold;
    margin: 0;
}

.sections-summary {
    font-size: 0.76rem;
    font-family: Arial, sans-serif;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 10px;
    background: #dce8f5;
    color: #1a3a6e;
    white-space: nowrap;
}

.sections-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    border: 1px solid #ddd8c8;
    border-radius: 4px;
    background: #fff;
    max-height: 220px;
    overflow-y: auto;
}

.sec-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 10px;
    border-bottom: 1px solid #eee8d8;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: background 0.15s;
    font-family: Arial, sans-serif;
    font-size: 0.88rem;
}

.sec-item:last-child { border-bottom: none; }

.sec-item.sec-present { border-left-color: #2e7d32; }
.sec-item.sec-missing  { border-left-color: #b71c1c; }

.sec-item:hover   { background: #f0ede8; }
.sec-item.selected { background: #dce8f5; }

.sec-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.sec-dot.present { background: #2e7d32; }
.sec-dot.missing  { background: #b71c1c; }

.sec-name {
    flex: 1;
    color: #2c2c2c;
}

.sec-empty,
.sec-loading {
    padding: 10px 14px;
    font-family: Arial, sans-serif;
    font-size: 0.85rem;
    color: #888;
}

.btn-sec {
    padding: 3px 9px;
    font-size: 0.75rem;
    font-family: Arial, sans-serif;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0;
    transition: background 0.15s, opacity 0.15s;
}

.sec-item:hover .btn-sec,
.sec-item.selected .btn-sec {
    opacity: 1;
}

.btn-sec-edit {
    background: #e8f0fb;
    color: #1a3a6e;
}
.btn-sec-edit:hover { background: #c8d8f0; }

.btn-sec-del {
    background: #fce8e8;
    color: #b71c1c;
}
.btn-sec-del:hover { background: #f5c8c8; }

.sections-body {
    display: flex;
    gap: 0;
    align-items: flex-start;
}

.sections-left {
    flex: 1 1 auto;
    min-width: 180px;
    display: flex;
    flex-direction: column;
}

.sections-right {
    flex: 1 1 auto;
    min-width: 200px;
    border-left: 1px solid #ddd8c8;
    padding-left: 14px;
    margin-left: 14px;
    display: flex;
    flex-direction: column;
}

.sections-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.sections-footer .hint {
    margin: 0;
    font-style: italic;
}

.sec-files-header {
    font-size: 0.82rem;
    font-family: Arial, sans-serif;
    font-weight: bold;
    color: #555;
    margin-bottom: 6px;
}

.sec-files-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #ddd8c8;
    border-radius: 4px;
    background: #fff;
    max-height: 220px;
    overflow-y: auto;
}

.sec-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-bottom: 1px solid #eee8d8;
    font-family: Arial, sans-serif;
    font-size: 0.85rem;
}

.sec-file-item:last-child { border-bottom: none; }

.sec-file-name {
    flex: 1;
    color: #2c2c2c;
    word-break: break-all;
}

.sec-file-size {
    color: #888;
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.sec-file-empty {
    padding: 10px 14px;
    font-family: Arial, sans-serif;
    font-size: 0.85rem;
    color: #888;
    list-style: none;
}

.btn-file-del {
    padding: 3px 9px;
    font-size: 0.75rem;
    font-family: Arial, sans-serif;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    background: #fce8e8;
    color: #b71c1c;
    transition: background 0.15s;
}

.btn-file-del:hover { background: #f5c8c8; }

/* ── Section file type badges ─────────────────────────────────────────────── */

.sec-file-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.68rem;
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex-shrink: 0;
    white-space: nowrap;
}

.badge-txt  { background: #e8f5e9; color: #2e7d32; }
.badge-img  { background: #e3f2fd; color: #1565c0; }
.badge-doc  { background: #fff8e1; color: #e65100; }
.badge-link { background: #f3e5f5; color: #6a1b9a; }

/* ── Document upload panel ───────────────────────────────────────────────── */

.doc-upload-panel {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 2px dashed #c8a951;
}

.doc-upload-panel h3 {
    margin: 0 0 .35rem;
    font-size: 1rem;
    color: #1a3a6e;
    font-family: Arial, sans-serif;
}

.text-input {
    padding: .45rem .6rem;
    border: 1px solid #b0b8c1;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: .93rem;
    flex: 1;
    min-width: 0;
}

.text-input:focus {
    outline: none;
    border-color: #2a5298;
    box-shadow: 0 0 0 2px rgba(42,82,152,0.15);
}

.sec-file-sub {
    color: #888;
    font-size: .8em;
    font-weight: normal;
}

/* ── Administration section ───────────────────────────────────────────────── */

.upload-admin {
    border-color: #b0b8c1;
    background: #f8f9fb;
}

.upload-admin h2 {
    color: #37474f;
    border-bottom-color: #90a4ae;
}

.admin-block {
    padding: 18px 0 18px;
    border-bottom: 1px solid #dde3e8;
}

.admin-block:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.admin-block h3 {
    font-size: 0.97rem;
    color: #1a3a6e;
    font-family: Arial, sans-serif;
    margin-bottom: 6px;
}

.admin-block-danger h3 {
    color: #b71c1c;
}

.admin-block-danger {
    background: #fff8f8;
    border-radius: 5px;
    padding: 16px 18px;
    border: 1px solid #f5c8c8;
    margin-top: 8px;
}

.btn-admin-dl {
    display: inline-block;
    text-decoration: none;
    margin-top: 4px;
}

.btn-danger {
    background: #b71c1c;
}

.btn-danger:hover:not(:disabled) {
    background: #c62828;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .header-text h1   { font-size: 1.2rem; }
    .logo             { height: 60px; }
    .login-box        { padding: 24px 18px; }
    .listbox-row      { flex-direction: column; }
    .file-row         { flex-direction: column; align-items: flex-start; }
    .sections-body    { flex-direction: column; }
    .sections-right   { border-left: none; border-top: 1px solid #ddd8c8; padding-left: 0; padding-top: 14px; margin-left: 0; margin-top: 14px; }
    .upload-section   { padding: 20px 18px; }
}
