/* --- Modernized Root Variables --- */
:root {
    --ceb-blue: #003399;
    --ceb-blue-hover: #002266;
    --accent: #2196F3;
    --success: #10b981;
    --danger: #ef4444;
    --bg-body: #f1f5f9;
    --white: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
}

/* --- Base Styles --- */
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    /* Changed 'center' to 'bottom' */
    background: var(--bg-body) url('../img/smart_grid.png') fixed no-repeat bottom;
    background-size: cover;
    color: var(--text-dark);
    line-height: 1.5;
}

/* --- Layout Containers --- */
.main-content {
    flex: 1;
    width: 100%;
    padding-bottom: 40px;
}

.main-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
}

.form-card {
    background: var(--white);
    width: 100%;
    max-width: 600px;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

/* --- Header & Navigation --- */
/* --- Modern Navigation Bar --- */
.topnav {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link img {
    height: 40px;
    display: block;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-item {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

    .nav-item:hover {
        color: var(--ceb-blue);
    }

.logout-btn {
    color: #ef4444; /* Soft red for logout */
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

    .logout-btn:hover {
        color: #b91c1c;
    }

/* Mobile Responsive */
@media (max-width: 600px) {
    .nav-links {
        gap: 15px;
    }

    .nav-item span {
        display: none;
    }
    /* Hide text on very small screens if needed */
}

.header-container {
    background: rgba(255, 255, 255, 0.85);
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(5px);
}

.header-title-text {
    color: var(--ceb-blue);
    font-size: clamp(20px, 5vw, 40px);
    font-weight: 800;
    margin: 0;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Custom Select Container/Control */
/* --- Shared Input & Select Styles --- */
.input-control {
    width: 100% !important; /* Forces full width  */
    display: block; /* Ensures it behaves as a block element */
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text-dark)[cite: 1];
    background-color: #ffffff[cite: 1];
    transition: all 0.2s ease[cite: 1];
    box-sizing: border-box; /* Crucial: Includes padding in the 100% width  */
    outline: none[cite: 1];
}

/* --- Dropdown Specific Styling --- */
select.input-control {
    appearance: none; /* Removes default browser arrow */
    -webkit-appearance: none; /* For Safari/Chrome */
    -moz-appearance: none; /* For Firefox */
    /* Subtle SVG Arrow Icon */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center; /* Pins arrow to the right */
    background-size: 1.2em;
    padding-right: 40px; /* Prevents text from overlapping the arrow */
    cursor: pointer;
}

/* --- Interactive States --- */
.input-control:hover {
    border-color: var(--accent);
}

.input-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.1);
}

/* Specific fix for ReadOnly textboxes so they don't look like active inputs */
.input-control[readonly] {
    background-color: #f1f5f9;
    background-image: none !important; /* Ensure no arrow on readonly IDs */
    cursor: not-allowed;
    color: var(--text-muted);
}

/* Container must be relative so the absolute tooltip stays attached to it */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: var(--accent);
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #2d3748; /* Dark modern slate */
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 10px;
    
    /* Position the tooltip above the icon */
    position: absolute;
    z-index: 999;
    bottom: 150%; 
    left: 50%;
    transform: translateX(-50%); /* Perfectly center horizontally */
    
    /* Animation */
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none; /* Prevents the tooltip from flickering */
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

/* Tooltip Arrow */
.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2d3748 transparent transparent transparent;
}

/* Hover State */
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-10px); /* Slight slide up effect */
}

/* Layout Overhaul */
.page-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Sidebar Progress Flow */
.progress-sidebar {
    width: 280px;
    position: sticky;
    top: 100px;
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.step-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 10px;
    color: var(--text-muted);
    font-weight: 600;
    position: relative;
    transition: 0.3s;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
}

.step-item.step-active { color: var(--ceb-blue); }
.step-item.step-active .step-number { background: var(--ceb-blue); color: white; }

/* Progress Line Connector */
.step-item:not(:last-child):after {
    content: '';
    position: absolute;
    left: 25px;
    top: 47px;
    width: 2px;
    height: 30px;
    background: #e2e8f0;
}

/* Modern Accordion/Collapsible */
.collapsible {
    background-color: white !important;
    color: var(--text-dark) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px;
    margin-bottom: 10px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    transition: 0.3s;
}

.collapsible.active {
    border-color: var(--ceb-blue) !important;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
    background-color: #f8fafc !important;
}

.content {
    background-color: white;
    border: 1px solid var(--border);
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    margin-bottom: 15px;
}

/* --- Custom Components --- */
.info {
    background-color: var(--ceb-light);
    border-left: 5px solid var(--accent);
    padding: 1rem;
    margin: 1.5rem auto;
    max-width: 800px;
    border-radius: 4px;
    font-style: italic;
    font-size: 0.9rem;
}

.check-text {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
}

/* --- Referral Alert --- */
#ref_info_box {
    margin-top: 15px;
    padding: 12px;
    background: #fff1f2;
    border-radius: 8px;
    border-left: 4px solid var(--danger);
}

/* --- Info Box Overhaul --- */
.w3-animate-fading {
    animation: none; /* Removed heavy animation for professional look */
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--ceb-blue);
    font-weight: 500;
    padding: 12px;
    border-radius: var(--radius-md);
}

@keyframes fading { 0% { opacity: 0 } 50% { opacity: 1 } 100% { opacity: 0 } }

/* --- Checkbox Styling --- */
.checkbox_container {
    display: flex;
    align-items: center;
    background: #f8fafc;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    transition: all 0.2s;
}

    .checkbox_container:hover {
        border-color: var(--accent);
        background: #f0f7ff;
    }

.checkbox_container input {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    accent-color: var(--accent);
}

/* --- Logic States (Hiding elements) --- */
#to_hide_action {
    display: none !important;
}

.info:empty {
    display: none;
}

/* --- Footer & Buttons --- */
.action-footer-panel {
    background: white;
    padding: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.btn {
    background-color: var(--ceb-blue);
    color: white;
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn:hover { background-color: #002266; transform: translateY(-1px); }

.footer_links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.footer_links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
}
.hide-field {
    display: none !important;
}

/* --- Landing Page Layout --- */
.landing-page {
    background: #f8fafc;
    margin: 0;
    padding: 0;
}

.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px); /* Modern frosted glass effect */
    padding: 0.75rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-title {
    font-size: 1.5rem;
    color: var(--ceb-blue);
    font-weight: 700;
}

.highlight {
    color: var(--accent);
}
.highlight1 {
    color: #fdb927;
}

.logo-small {
    height: 45px; /* Controlled height */
    width: auto;
    object-fit: contain;
}

.portal-title {
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    margin: 0;
}

/* --- Redesigned Hero Section --- */
.hero-section {
    position: relative;
    padding: 100px 20px;
    text-align: center;
    border-radius: 24px;
    margin: 20px auto;
    max-width: 1100px;
    overflow: hidden;
    /* --- BLACK OVERLAY LOGIC --- */
    /* 0.6 = 60% black opacity. Increase to 0.8 for a darker look if the image is very bright */
    background: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)), url('../img/smart_grid.png') no-repeat center center;
    background-size: cover;
    background-attachment: fixed; /* Parallax effect: image stays still while scrolling */
    /* Subtle outer glow to make the whole section stand out from the page bg */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

    .hero-section h2 {
        font-size: 3.5rem;
        font-weight: 800;
        color: #ffffff; /* Pure white for maximum contrast */
        line-height: 1.1;
        margin-bottom: 10px;
        text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); /* Shadow makes text pop further */
    }

    .hero-section h3 {
        font-size: 1.8rem;
        color: #ffffff;
        font-weight: 600;
        margin-bottom: 20px;
    }

    .hero-section .highlight1 {
        color: #38bdf8; /* Modern sky-blue accent for 'eServices' */
        font-weight: 700;
    }

    .hero-section p {
        font-size: 1.2rem;
        color: rgba(255, 255, 255, 0.9); /* Slightly transparent white for secondary text */
        max-width: 600px;
        margin: 0 auto;
        font-weight: 400;
        line-height: 1.6;
    }

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding: 60px 15px;
        border-radius: 0; /* Full width on mobile */
    }

        .hero-section h2 {
            font-size: 2.2rem;
        }
}

.status-badge b {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    text-transform: uppercase;
    display: inline-block;
    background: rgba(0,0,0,0.05);
}

#ContentPlaceHolder1_lblCapacityDisplay {
    border-left: 2px solid var(--border-color);
    padding-left: 15px;
}

/* --- Service Card Enhancements --- */
/* --- Modernized Service Cards with Fading Backgrounds --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Forces exactly 2 equal columns */
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto 50px auto;
    padding: 0 20px;
}
.service-card {
    position: relative;
    background-color: #00285e; /* The base color the image fades into */
    padding: 40px 30px;
    border-radius: 20px;
    overflow: hidden; /* Keeps the image inside the rounded corners */
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
    text-align: center;
    min-height: 300px;
}

/* --- Modernized Service Cards --- */
.service-card {
    background: #00285e; /* Deep Navy Blue */
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    text-align: center;
    cursor: pointer;
}

    /* Ensure all text inside the card is white by default */
    .service-card h3,
    .service-card p,
    .service-card .card-icon {
        color: #ffffff !important;
        transition: color 0.3s ease;
    }

    /* --- Hover State --- */
    .service-card:hover {
        background: #fdb927; /* Golden Yellow */
        transform: translateY(-12px);
        box-shadow: 0 20px 30px rgba(253, 185, 39, 0.3);
        border-color: #fdb927;
    }

        /* Change text color to dark blue on hover for readability */
        .service-card:hover h3,
        .service-card:hover p,
        .service-card:hover .card-icon {
            color: #00285e !important;
        }

    /* --- Button Adjustments inside Cards --- */
    .service-card .btn-outline,
    .service-card .btn-white {
        margin-top: auto;
        padding: 12px 20px;
        border-radius: 8px;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.3s ease;
    }

    /* Default button state (White border/text on Blue card) */
    .service-card .btn-outline {
        border: 2px solid #ffffff;
        color: #ffffff;
    }

    /* Button state on hover (Blue border/text on Yellow card) */
    .service-card:hover .btn-outline {
        border-color: #00285e;
        color: #00285e;
        background: rgba(0, 40, 94, 0.05);
    }

/* --- Buttons --- */
.btn-outline {
    display: inline-block;
    padding: 10px 24px;
    border: 2px solid var(--ceb-blue);
    color: var(--ceb-blue);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 1rem;
}

    .btn-outline:hover {
        background: var(--ceb-blue);
        color: white;
    }

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-section h2 {
        font-size: 2rem;
    }
}

/* --- Mobile Responsiveness --- */
@media screen and (max-width: 768px) {
    .header-container { flex-direction: column; text-align: center; }
    .form-card { padding: 20px; border-radius: 0; border: none; }
    .main-wrapper { padding: 10px 0; }
}