@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #faf9f6;
    --text-main: #1c1c1c;
    --text-muted: #64748b;
    --accent-gold: #c5a059;
    --accent-gold-light: #e6c584;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    
    color-scheme: light;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 87.5%; /* Reverted to 16px baseline */ /* Increased base font size */
    line-height: 1.6;
    color: var(--text-main);
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg-main);
    color: var(--text-main);
}

/* TYPOGRAPHY */
h1, h2, h3, .serif-title {
    font-family: 'Merriweather', serif;
    color: var(--text-main);
}

.serif-title {
    font-size: clamp(2rem, 3vw, 2.5rem);
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* SPLIT LAYOUT */
.split-layout {
    display: flex;
    min-height: 100vh;
}

.split-left {
    flex: 0 0 45%;
    position: relative;
    background: url('../authentic_church_bg.png') center center / cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3.75rem;
    color: #fff;
}

.split-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 100%);
    z-index: 1;
}

.split-left-content {
    position: relative;
    z-index: 2;
    max-width: 31.25rem;
}

.split-left-content h1.serif-title {
    color: #ffffff;
    text-shadow: 0 0.25rem 1rem rgba(0,0,0,0.6);
}

.brand-logo {
    width: 4rem;
    height: 4rem;
    border-radius: 0.75rem;
    background: #fff;
    padding: 0.5rem;
    margin-bottom: 2rem;
}

.split-left-content p {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.6;
    opacity: 0.9;
}

.trust-signals {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 0.0625rem solid rgba(255,255,255,0.2);
}

.scripture {
    font-family: 'Merriweather', serif;
    font-size: 1.25rem;
    font-style: italic;
    margin: 0 0 0.5rem;
}
.trust-signals span {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
    font-weight: 600;
}

.split-right {
    flex: 1;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.right-inner {
    max-width: 50rem;
    width: 100%;
    margin: 0 auto;
    padding: 3.75rem 2.5rem;
}

/* WIZARD & FORMS */
.form-header {
    margin-bottom: 3rem;
}
.form-header h2 {
    font-size: 2rem;
    margin: 0 0 0.75rem;
}
.form-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0;
}

.tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 3rem;
    border-bottom: 0.125rem solid var(--border-color);
    padding-bottom: 0.5rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
    position: relative;
}

.tab-button:hover { color: var(--text-main); }
.tab-button.active { color: var(--accent-gold); }

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -0.625rem;
    left: 0;
    right: 0;
    height: 0.125rem;
    background: var(--accent-gold);
}

/* WIZARD PANELS */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.5s ease forwards; }

.wizard-step { display: none; }
.wizard-step.active { display: block; animation: slideUpFade 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

.section-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
}

.form-grid { display: grid; gap: 2rem; }
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* FLOATING LABELS & INPUTS */
.form-group {
    position: relative;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    border: 0.0625rem solid var(--border-color);
    border-radius: 0.5rem;
    background: #ffffff;
    padding: 1.625rem 1rem 0.625rem;
    font-size: 1.1rem;
    font-family: inherit;
    color: var(--text-main);
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 0.0625rem 0.1875rem rgba(0,0,0,0.02);
}

.form-control:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 0.1875rem rgba(197, 160, 89, 0.15);
}

.form-group .form-label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    background: transparent;
    padding: 0 0.25rem;
}

input[required] ~ .form-label::after,
textarea[required] ~ .form-label::after,
select[required] ~ .form-label::after {
    content: " *";
    color: #e11d48;
}

.form-group .form-control:focus ~ .form-label,
.form-group .form-control:not(:placeholder-shown) ~ .form-label {
    top: 0.5rem;
    font-size: 0.75rem;
    color: var(--accent-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* For labels that are not in a floating setup */
div:not(.form-group) > .form-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

textarea.form-control {
    min-height: 6.25rem;
    resize: vertical;
}

/* CHECKBOXES & RADIOS */
.section-group {
    margin-bottom: 2rem;
}
.section-group > div { margin-bottom: 1.5rem; }
.font-semibold { font-weight: 600; margin-bottom: 0.75rem; font-size: 1.1rem; }

.choice-list { display: grid; gap: 0.75rem; }
.choice-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 0.0625rem solid var(--input-border);
    border-radius: 0.5rem;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.choice-label:hover { border-color: var(--text-muted); }
.choice-label:has(input:checked) {
    border-color: var(--accent-gold);
    background: rgba(197, 160, 89, 0.05);
}

input[type="checkbox"], input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--accent-gold);
}

/* PROGRESS & BUTTONS */
.wizard-header { margin-bottom: 2.5rem; }
.wizard-step-status {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.wizard-step-status strong { color: var(--text-main); }
.wizard-progress {
    height: 0.25rem;
    background: var(--border-color);
    border-radius: 0.125rem;
    overflow: hidden;
}
.wizard-progress-bar {
    height: 100%;
    background: var(--accent-gold);
    transition: width 0.4s ease;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 0.0625rem solid var(--border-color);
}

.button-primary, .button-secondary {
    padding: 1rem 2.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button-primary {
    background: var(--text-main);
    color: #fff;
    border: none;
}
.button-primary:hover {
    background: var(--accent-gold);
}

.button-secondary {
    background: transparent;
    border: 0.0625rem solid var(--input-border);
    color: var(--text-main);
}
.button-secondary:hover:not(:disabled) {
    border-color: var(--text-main);
}
.button-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

/* NOTICES */
.notice-banner {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    background: #f0fdf4;
    color: #166534;
    border: 0.0625rem solid #bbf7d0;
}
.notice-banner.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ADMIN OVERRIDES */
.page-shell {
    max-width: 73.75rem;
    margin: 0 auto;
    padding: 3.75rem 1.5rem;
}
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}
.table-card {
    background: #fff;
    border-radius: 0.5rem;
    border: 0.0625rem solid var(--border-color);
    overflow-x: auto;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.03);
}
table { width: 100%; border-collapse: collapse; min-width: 56.25rem; }
th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 0.0625rem solid var(--border-color);
}
th { font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.05em; }
tbody tr:hover { background: #f8fafc; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(1.25rem); } to { opacity: 1; transform: translateY(0); } }

/* RESPONSIVE */
@media (max-width: 60rem) {
    .split-layout { flex-direction: column; }
    .split-left { flex: none; min-height: 40vh; padding: 2.5rem 1.5rem; }
    .right-inner { padding: 2.5rem 1.5rem; }
    .form-row { grid-template-columns: 1fr; }
    .serif-title { font-size: 2.5rem; }
    
    .admin-dashboard { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; border-right: none; border-bottom: 0.0625rem solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; }
    .sidebar-footer { position: relative; padding: 0; border: none; }
    .admin-main { padding: 1.5rem; }
}

/* ========================================================================= */
/* PHASE 3: ADMIN DASHBOARD SPECIFIC STYLES                                   */
/* ========================================================================= */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-gold { color: var(--accent-gold); }

/* ADMIN LOGIN */
.login-mode {
    background: url('../authentic_church_bg.png') center center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-mode::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(0.5rem);
    -webkit-backdrop-filter: blur(0.5rem);
}
.admin-login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 27.5rem;
    padding: 1.5rem;
}
.admin-login-card {
    background: #ffffff;
    border-radius: 1rem;
    padding: 3rem 2rem;
    box-shadow: 0 1.5rem 4rem rgba(0,0,0,0.3);
}

/* ADMIN DASHBOARD LAYOUT */
.dashboard-mode {
    background: #f1f5f9;
}
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
    width: 16.25rem;
    background: #ffffff;
    border-right: 0.0625rem solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}
.sidebar-brand {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 0.0625rem solid var(--border-color);
}
.sidebar-logo {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    background: var(--text-main);
    padding: 0.375rem;
}
.sidebar-title {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    line-height: 1.2;
    font-size: 1.1rem;
    color: var(--text-main);
}
.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.nav-item {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.nav-item:hover {
    background: #f8fafc;
    color: var(--text-main);
}
.nav-item.active {
    background: rgba(197, 160, 89, 0.1);
    color: var(--accent-gold);
}
.sidebar-footer {
    padding: 1.5rem 1rem;
    border-top: 0.0625rem solid var(--border-color);
}

/* MAIN CONTENT */
.admin-main {
    flex: 1;
    padding: 3rem;
    overflow-x: hidden;
}
.admin-header {
    margin-bottom: 2.5rem;
}

/* KPI CARDS */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.75rem, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.kpi-card {
    background: #ffffff;
    border: 0.0625rem solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.02);
}
.kpi-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    font-family: 'Merriweather', serif;
}

/* ADMIN TABLE ENHANCEMENTS */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-bottom: 0.125rem solid var(--border-color);
}
.admin-table td {
    padding: 1rem 1.5rem;
    border-bottom: 0.0625rem solid var(--border-color);
    vertical-align: middle;
}
.admin-table tbody tr:hover td {
    background: #f8fafc;
}

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 62.4375rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-switchers { background: #e0e7ff; color: #4338ca; }
.badge-builders  { background: #dcfce7; color: #15803d; }
.badge-restorers { background: #fef3c7; color: #b45309; }
.badge-repairers { background: #fee2e2; color: #b91c1c; }
.badge-default   { background: #f1f5f9; color: #475569; }

/* ========================================================================= */
/* PHASE 4: SUCCESS SCREEN ANIMATIONS & STYLES                               */
/* ========================================================================= */
.success-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    animation: fadeIn 0.8s ease forwards;
}

.success-icon-wrapper {
    width: 6rem;
    height: 6rem;
    background: rgba(197, 160, 89, 0.1);
    color: var(--accent-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.next-steps-card {
    background: #f8fafc;
    border: 0.0625rem solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 30rem;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.02);
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ========================================================================= */
/* PREMIUM BUTTON STYLES                                                     */
/* ========================================================================= */
.wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 0.0625rem solid var(--border-color);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

.button-primary, .button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.button-primary {
    background: var(--accent-gold);
    color: #ffffff;
    box-shadow: 0 0.25rem 0.75rem rgba(197, 160, 89, 0.3);
}

.button-primary:hover:not(:disabled) {
    background: var(--text-main);
    color: #ffffff;
    transform: translateY(-0.125rem);
    box-shadow: 0 0.375rem 1rem rgba(0, 0, 0, 0.15);
}

.button-secondary {
    background: transparent;
    color: var(--text-main);
    border: 0.0625rem solid var(--border-color);
}

.button-secondary:hover:not(:disabled) {
    background: var(--bg-main);
    border-color: var(--text-muted);
}

.button-primary:disabled, .button-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========================================================================= */
/* MOBILE RESPONSIVENESS - ADMIN DASHBOARD                                   */
/* ========================================================================= */
@media (max-width: 900px) {
    .admin-dashboard {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 1rem;
        border-right: none;
        border-bottom: 0.0625rem solid var(--border-color);
        flex-wrap: wrap;
    }
    .sidebar-brand {
        padding: 0.5rem 0;
        border-bottom: none;
    }
    .sidebar-nav {
        flex: unset;
        display: flex;
        flex-direction: row;
        padding: 0;
        gap: 0.5rem;
    }
    .sidebar-footer {
        padding: 0;
        border-top: none;
    }
    .nav-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    .admin-main {
        padding: 1.5rem 1rem;
    }
    .table-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .admin-table th, .admin-table td {
        white-space: nowrap;
    }
}

@media (max-width: 600px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        flex-direction: column;
        align-items: flex-start;
    }
    .sidebar-nav {
        flex-wrap: wrap;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    .sidebar-footer {
        width: 100%;
    }
    .sidebar-footer .nav-item {
        text-align: center;
        background: #f8fafc;
    }
    .admin-login-card {
        padding: 2rem 1.5rem;
    }
}
