/**
 * =========================================================================
 * CITY OF KORONADAL - PORTAL LOGIN STYLESHEET (portal-login.css)
 * Shared design system, layout, typography, dark mode & modal styling
 * for Staff (Admin) & Beneficiary login portals.
 * =========================================================================
 */

:root {
    --primary-pink: #F0B6C6;
    --primary-dark: #B88A9A;
    --primary-light: #F7D2DE;
    --dark-deep: #2F2B2E;
    --light-bg: #fbf6f8;
    --text-dark: #2c2528;
    --text-muted: #726468;
    --border-color: #F7D2DE;
    --card-shadow: 0 10px 30px rgba(240, 182, 198, 0.08);
    --modal-shadow: 0 20px 50px rgba(47, 43, 46, 0.15);
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #dc3545;
}

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

body {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    background-color: var(--light-bg);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700 !important;
}

/* =========================================================================
   SPLIT SCREEN LAYOUT & BRANDING PANELS
   ========================================================================= */
.page-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Left Panel - Hero Background */
.left-panel {
    flex: 1.2;
    position: relative;
    background: linear-gradient(135deg, rgba(184, 92, 122, 0.6) 0%, rgba(30, 15, 20, 0.92) 100%),
                url('../city_of_koronadal.jpeg') center/cover no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px;
    color: white;
    overflow: hidden;
}

.left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(215, 127, 161, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.left-panel-header {
    position: relative;
    z-index: 10;
}

.lgu-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.left-panel-content {
    position: relative;
    z-index: 10;
    max-width: 580px;
    margin-top: auto;
}

.left-panel h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.left-panel p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.feature-badge-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.feature-badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Right Panel - Form Area */
.right-panel {
    width: 480px;
    min-width: 450px;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 50px 45px;
    box-shadow: -10px 0 35px rgba(30, 20, 25, 0.03);
    position: relative;
    z-index: 2;
    overflow-y: auto;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.brand-header {
    text-align: center;
    margin-bottom: 25px;
}

.seal-container {
    width: 90px;
    height: 90px;
    margin: 0 auto 15px;
}

.seal-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portal-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.portal-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Navigation Links */
.support-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.nav-link-custom {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none;
    position: relative;
    padding: 2px 0;
    transition: color 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.nav-link-custom::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-pink);
    transition: width 0.25s ease;
}

.nav-link-custom:hover {
    color: var(--primary-pink);
}

.nav-link-custom:hover::after {
    width: 100%;
}

.nav-separator {
    color: #d8c2c8;
    font-size: 0.8rem;
}

/* =========================================================================
   LOGIN CARD & FORM INPUTS
   ========================================================================= */
.login-card {
    width: 100%;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

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

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-dark);
    background-color: #fcf9fa;
    transition: all 0.25s ease;
}

.form-control::placeholder {
    color: #bfaab1;
}

.form-control:focus {
    outline: none;
    background-color: #fff;
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 3.5px rgba(215, 127, 161, 0.15);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: var(--primary-pink);
}

.btn-login {
    width: 100%;
    padding: 12px 20px;
    background-color: var(--primary-pink);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    box-shadow: 0 4px 10px rgba(215, 127, 161, 0.3);
}

.btn-login:hover:not(:disabled) {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(184, 92, 122, 0.4);
}

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

.btn-login:disabled {
    background-color: #e0d5d8;
    color: #a89a9d;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-register-link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 11px 20px;
    margin-top: 12px;
    background-color: transparent;
    color: var(--primary-dark);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.btn-register-link:hover {
    background-color: #fff9fa;
    border-color: var(--primary-pink);
    color: var(--primary-pink);
}

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: none;
    text-align: left;
    border: 1px solid transparent;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.08);
    color: #b02a37;
    border-color: rgba(220, 53, 69, 0.15);
}

.alert-success {
    background: rgba(40, 167, 69, 0.08);
    color: #146c43;
    border-color: rgba(40, 167, 69, 0.15);
}

/* Loading Spinner */
.spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.footer-version {
    margin-top: auto;
    padding-top: 30px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* =========================================================================
   MODAL OVERLAYS & COMPLIANCE STYLES
   ========================================================================= */
.custom-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.custom-modal.active {
    display: flex;
}

.custom-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(47, 43, 46, 0.6);
    backdrop-filter: blur(4px);
    z-index: -1;
}

.custom-modal-dialog {
    background: white;
    width: 100%;
    max-width: 650px;
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: var(--modal-shadow);
    display: flex;
    flex-direction: column;
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    border: 1px solid var(--border-color);
}

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

.custom-modal-header {
    padding: 20px 24px;
    border-bottom: 1.5px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title-icon {
    width: 40px;
    height: 40px;
    background: #fff0f4;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-size: 1.25rem;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.btn-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-modal-close:hover {
    background: #fbf6f8;
    color: var(--primary-dark);
}

.custom-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #443c3f;
}

.custom-modal-footer {
    padding: 16px 24px;
    border-top: 1.5px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    background: #fdfafb;
    border-radius: 0 0 16px 16px;
}

/* Compliance Cards inside Modal */
.compliance-section {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    background-color: #fff9fa;
    margin-bottom: 20px;
}

.compliance-badge {
    background-color: var(--primary-dark);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 12px;
}

.compliance-section h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.compliance-section h5 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #615055;
    margin-top: 12px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.compliance-section p, .compliance-section ul {
    font-size: 0.88rem;
    color: #574d51;
    margin-bottom: 10px;
}

.compliance-section ul {
    padding-left: 20px;
}

/* Checkbox & Scroll Compliance */
.checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.checkbox-wrap input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-pink);
    cursor: pointer;
    border: 1.5px solid var(--primary-light);
    border-radius: 4px;
}

.scroll-notice {
    background-color: #fcf1f4;
    border-left: 4px solid var(--primary-pink);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: inset 0 1px 3px rgba(184, 92, 122, 0.03);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
}

.scroll-notice.completed {
    background-color: #f1fcf4;
    border-left-color: #28a745;
    color: #155724 !important;
    border-color: #d4edda;
    border-left-width: 4px;
}

.checkbox-wrap input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    accent-color: var(--text-muted);
}

.checkbox-wrap input[type="checkbox"]:disabled + label {
    color: var(--text-muted) !important;
    opacity: 0.65;
    cursor: not-allowed;
}

/* FAQ Accordion Styling */
.faq-item {
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    background: white;
    transition: all 0.25s ease;
}

.faq-item:hover {
    border-color: var(--primary-light);
}

.faq-question {
    padding: 16px 20px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfcfd;
    user-select: none;
}

.faq-question i {
    transition: transform 0.25s ease;
    color: var(--primary-dark);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0, 1, 0, 1);
    font-size: 0.88rem;
    color: #5c5054;
    line-height: 1.6;
}

.faq-item.active {
    border-color: var(--primary-pink);
    box-shadow: 0 4px 15px rgba(215, 127, 161, 0.05);
}

.faq-item.active .faq-question {
    background: #fff9fa;
    color: var(--primary-dark);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-item.active .faq-answer {
    padding: 16px 20px;
    max-height: 1000px;
    border-top: 1.5px solid var(--border-color);
    transition: all 0.25s cubic-bezier(1, 0, 1, 0);
}

/* Portal Cross-Link */
.back-portal-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}

.back-portal-link a {
    color: var(--primary-pink);
    text-decoration: none;
    font-weight: 600;
}

.back-portal-link a:hover {
    text-decoration: underline;
}

/* =========================================================================
   DARK MODE ADAPTATIONS
   ========================================================================= */
body.dark-mode {
    --light-bg: #2F2B2E;
    --text-dark: #f5f5f5;
    --border-color: #3e383c;
    background-color: #2F2B2E;
    color: #f5f5f5;
}

body.dark-mode .right-panel {
    background-color: #1E1B1D;
    color: #f5f5f5;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.3);
}

body.dark-mode .form-control {
    background-color: #2c272a;
    border-color: #3e383c;
    color: #fff;
}

body.dark-mode .form-control::placeholder {
    color: #726468;
}

body.dark-mode .form-control:focus {
    background-color: #2c1a23;
    border-color: var(--primary-pink);
}

body.dark-mode .custom-modal-dialog {
    background: #1c1115;
    border-color: #352229;
}

body.dark-mode .custom-modal-header,
body.dark-mode .custom-modal-footer {
    border-bottom-color: #352229;
    border-top-color: #352229;
    background: #1c1115;
}

body.dark-mode .custom-modal-body {
    color: #e5e5e5;
}

body.dark-mode .compliance-section {
    background-color: #25181e;
    border-color: #352229;
}

body.dark-mode .compliance-section h4,
body.dark-mode .compliance-section h5,
body.dark-mode .compliance-section p,
body.dark-mode .compliance-section ul,
body.dark-mode .compliance-section li {
    color: #e5e5e5 !important;
}

body.dark-mode .global-controls button,
body.dark-mode .support-nav a {
    background-color: #1c1115 !important;
    color: #f5f5f5 !important;
    border-color: #352229 !important;
}

body.dark-mode .global-controls button:hover,
body.dark-mode .support-nav a:hover {
    background-color: #25181e !important;
}

body.dark-mode .portal-title,
body.dark-mode .card-title {
    color: #fff;
}

body.dark-mode .scroll-notice {
    background-color: #25181e;
    border-color: #352229;
    color: #e5e5e5;
}

body.dark-mode .faq-item {
    background: #1e171a;
    border-color: #352229;
}

body.dark-mode .faq-question {
    background: #1e171a;
    color: #f5f5f5;
}

body.dark-mode .faq-answer {
    color: #d1c5c9;
}

body.dark-mode .btn-register-link {
    border-color: #352229;
    color: var(--primary-pink);
}

/* =========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================= */
@media (max-width: 992px) {
    .page-container {
        flex-direction: column;
    }
    .left-panel {
        min-height: 280px;
        padding: 40px 30px;
        justify-content: center;
    }
    .left-panel h1 {
        font-size: 2.2rem;
        margin-bottom: 10px;
    }
    .left-panel p {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    .feature-badge-container {
        display: none;
    }
    .right-panel {
        width: 100%;
        min-width: 100%;
        padding: 40px 25px;
    }
    .support-nav {
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .left-panel {
        min-height: 220px;
        padding: 30px 20px;
    }
    .left-panel h1 {
        font-size: 1.8rem;
    }
    .left-panel p {
        font-size: 0.9rem;
    }
    .right-panel {
        padding: 30px 20px;
    }
    .portal-title {
        font-size: 1.4rem;
    }
    .nav-link-custom {
        font-size: 0.78rem;
    }
}
