/* =================================================
   GLOBAL
================================================= */
html,
body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #f8fafc;
    font-family: "Inter", system-ui, sans-serif;
    color: #1e293b;
}

.page-wrapper {
    flex: 1;
}

/* =================================================
   NAVBAR
================================================= */
.navbar-custom {
    background: linear-gradient(90deg, #628359, #bb7026);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
    height: 70px;
}

.navbar-logo {
    width: 46px;
    height: 46px;
    background: #fff;
    padding: 6px;
    border-radius: 8px;
}

.brand-title {
    color: #f97316;
    font-weight: 600;
    font-size: 18px;
}

.brand-subtitle {
    color: #22c55e;
    font-size: 12px;
}

/* =================================================
   HERO
================================================= */
.hero-section {
    background: #eefaf0;
}

.hero-container {
    padding: 80px 48px 100px;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
}

.hero-highlight {
    color: #22c55e;
}

.hero-image {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.hero-image img {
    width: 100%;
    max-width: 620px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .15);
}

/* =================================================
   MODAL
================================================= */
.modal-dialog.modal-xl {
    max-width: 92vw;
    height: 88vh;
    margin: 3vh auto;
}

.modal-content {
    height: 100%;
    border-radius: 32px;
    overflow: hidden;
}

.modal-body {
    padding: 0;
    height: 100%;
}

.modal-glass {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(22px);
    border-radius: 32px;
    border: 1px solid rgba(116, 42, 42, 0.999);
}

.col-lg-6{
    margin-bottom: 15px;
}

/* Close Button */
.modal-close-btn {
    position: absolute;
    top: 18px;
    right: 22px;
    z-index: 20;
    background: #ffffff;
    border: none;
    font-size: 26px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

/* =================================================
   FORM CONTAINER
================================================= */
.modern-form-container {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1.1fr 1.9fr;
    gap: 40px;
    padding: 40px;
}

/* =================================================
   GLASS PANELS
================================================= */
.glass {
    background: linear-gradient(135deg, #abd4a0, #dab264);
    border-radius: 32px;
    padding: 48px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, .22);
}

/* =================================================
   LEFT PANEL
================================================= */
.form-left {
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-left img {
    max-width: 100%;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
}

/* =================================================
   RIGHT PANEL
================================================= */
.form-right {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* =================================================
   FLOATING INPUTS
================================================= */
.floating-group {
    position: relative;
    margin-bottom: 26px;
}

.floating-group input,
.floating-group select {
    width: 100%;
    padding: 18px;
    border-radius: 18px;
    border: none;
    background: #f1f5f9;
    font-size: 16px;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(1, 10, 31, .15);
}

/* =================================================
   CHILDREN SECTION
================================================= */
.children-section {
    display: none;
}

.children-section.show {
    display: block;
    margin-bottom: 24px;
}

.children-header,
.children-row {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1.2fr 0.8fr 1.4fr 0.6fr;
    gap: 16px;
}

.children-header {
    background: #3b2505;
    color: #fff;
    padding: 14px 18px;
    border-radius: 14px;
    font-weight: 600;
}

.children-row {
    background: #ffffff;
    padding: 14px 18px;
    border-radius: 20px;
    margin-top: 10px;
    overflow: hidden;
}

/* =================================================
   FORM ACTIONS
================================================= */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 28px;
}

/* =================================================
   FOOTER
================================================= */
/* ===============================
   FOOTER LAYOUT
================================ */
.dark-footer {
    background: linear-gradient(90deg, #170c01, #2b1604);
    color: #e5e7eb;
    padding: 28px 16px;
    font-size: 14px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

/* Left */
.footer-left p {
    margin: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Center */
.footer-center {
    text-align: center;
    font-weight: 500;
    color: #f8fafc;
}

/* Right */
.footer-right {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
}

.footer-link {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
}

.footer-link:hover {
    color: #22c55e;
}

/* ===============================
   MOBILE FOOTER
================================ */
@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-left,
    .footer-right {
        justify-content: center;
    }

    .footer-right {
        margin-top: 12px;
    }

    .footer-left p {
        justify-content: center;
    }
}


/* =================================================
   ADD LEAD BUTTON
================================================= */
.add-lead-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 20px;
    background: #22230e;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(12, 12, 12, .35);
}

/* =================================================
   MOBILE RESPONSIVE
================================================= */
@media (max-width: 992px) {
    .modern-form-container {
        grid-template-columns: 1fr;
    }
}

/* =================================================
   MOBILE (FINAL FIXES)
================================================= */
@media (max-width: 576px) {

    /* Modal + form never overflow */
    .modal-content,
    .modal-body,
    .modern-form-container,
    .form-right {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Children details as vertical card */
    .children-header {
        display: none;
    }

    .children-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
        border-radius: 20px;
    }

    .children-row input,
    .children-row select {
        width: 100%;
    }

    .children-row .btn-danger {
        width: 100%;
        border-radius: 12px;
    }

    /* Navbar mobile polish */
    .navbar-custom .brochure-btn {
        display: none;
    }

    .navbar-custom .add-lead-btn {
        padding: 6px 10px;
        font-size: 13px;
        display: none;
    }

    /* Hero spacing */
    .hero-container {
        padding: 60px 18px;
    }

    .hero-title {
        font-size: 32px;
    }
}

/* =====================================
   BROCHURE VISIBILITY CONTROL
===================================== */

/* 🔒 Hide body brochure by default (desktop) */
.mobile-brochure-btn {
    display: none;
}

/* 📱 Mobile only */
@media (max-width: 576px) {

    /* ❌ Hide navbar brochure */
    .navbar-custom .brochure-btn {
        display: none !important;
    }

    /* ✅ Show body brochure */
    .mobile-brochure-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        border-radius: 18px;
        background: transparent;
        border: 2px solid #22230e;
        color: #22230e;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        text-decoration: none;
    }

    .mobile-brochure-btn i {
        font-size: 16px;
    }
}


/* =====================================
   MOBILE ONLY – CENTER FORM CONTENT
===================================== */
@media (max-width: 576px) {

    /* Center everything inside the right glass */
    .glass.form-right {
        align-items: center;
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Limit width so inputs sit in the middle */
    .glass.form-right h1,
    .glass.form-right p,
    .glass.form-right .floating-group,
    .glass.form-right .children-section,
    .glass.form-right .form-actions {
        width: 100%;
        max-width: 360px;
    }

    /* Inputs stretch nicely but stay centered */
    .floating-group input,
    .floating-group select {
        width: 100%;
    }

    /* Center buttons */
    .form-actions {
        justify-content: center;
    }
}

/* =================================================
   RIGHT FORM – TWO COLUMN LAYOUT (DESKTOP)
================================================= */
.right-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    width: 100%;
    align-items: start;
}

/* Each column */
.right-col {
    width: 100%;
}

/* Keep spacing consistent inside columns */
.right-col h5 {
    margin-bottom: 18px;
}

/* =================================================
   RESPONSIVE – STACK ON TABLET & MOBILE
================================================= */
@media (max-width: 992px) {
    .right-two-col {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* =====================================
   SOFT VERTICAL DIVIDER BETWEEN COLUMNS
===================================== */

.right-two-col {
    position: relative;
}

.left-divider-col {
    position: relative;
    padding-right: 36px;
    /* space before divider */
}

/* Divider line */
.left-divider-col::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 0;
    width: 1px;
    height: calc(100% - 16px);
    background: linear-gradient(to bottom,
            transparent,
            rgba(0, 0, 0, 0.15),
            transparent);
}

/* =================================================
   PARENT DETAILS – NAME + AGE COMPACT ROW
================================================= */

.parent-row {
    display: flex;
    gap: 10px;
    /* 🔑 small gap */
    align-items: flex-end;
    margin-bottom: 18px;
}

/* Age box smaller */
.parent-row .age-field {
    width: 60px;
    /* 🔑 keeps age compact */
    flex-shrink: 0;
}

/* Center age number */
.age-field input {
    text-align: center;
    padding-left: 12px;
    padding-right: 12px;
}

/* =================================================
   WIFE DETAILS – CLEAN STRUCTURE
================================================= */

/* Row 1: Wife name + age */
.wife-row-main {
    display: flex;
    gap: 10px;
    /* 🔑 same compact gap */
    align-items: flex-end;
    margin-bottom: 18px;
}

.wife-row-main .age-field {
    width: 60px;
    flex-shrink: 0;
}

/* Row 2: Qualification full width */
#wifeSection .floating-group {
    width: 100%;
}

/* =================================================
   IMPROVE READABILITY INSIDE RIGHT COLUMN
================================================= */

.right-col h5 {
    font-size: 17px;
    font-weight: 600;
}

.right-col h6 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* =================================================
   MOBILE FIX – STACK PROPERLY
================================================= */
@media (max-width: 576px) {

    .parent-row,
    .wife-row-main {
        flex-direction: column;
        gap: 12px;
    }

    .parent-row .age-field,
    .wife-row-main .age-field {
        width: 100%;
    }
}

/* =================================================
   PARENT DETAILS – NAME WIDER THAN AGE
================================================= */

/* Desktop only */
@media (min-width: 993px) {

    .parent-row {
        display: grid;
        grid-template-columns: 4.4fr 1.2fr;
        /* Name wider, Age smaller */
        gap: 12px;
        align-items: end;
    }

    /* Make age compact & centered */
    .parent-row .age-field input {
        text-align: center;
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* =================================================
   PARENT DETAILS – PERFECT NAME / AGE PROPORTION
================================================= */

/* Desktop */
@media (min-width: 993px) {

    .parent-row {
        display: grid;
        grid-template-columns: 4.5fr 1.2fr;
        /* Name wider, Age smaller */
        gap: 12px;
        align-items: end;
        margin-bottom: 18px;
    }

    .parent-row .age-field {
        max-width: 120px;
    }

    .parent-row .age-field input {
        text-align: center;
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Mobile */
@media (max-width: 576px) {

    .parent-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .parent-row .age-field {
        max-width: 100%;
    }
}

/* =================================================
   CHILDREN DETAILS – TABLE STYLE (DESKTOP)
================================================= */

.children-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.children-top strong {
    font-size: 17px;
    font-weight: 600;
}

/* Header */

.children-header {
    display: grid;
    grid-template-columns:
        1.2fr
        /* Gender */
        1.6fr
        /* Name */
        1.4fr
        /* Qualification */
        1.4fr
        /* Location */
        0.9fr
        /* Married */
        1.4fr
        /* Spouse */
        0.6fr;
    /* Action */
    gap: 12px;
    background: #3b2505;
    color: #ffffff;
    padding: 14px 18px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 14px;
}

/* Row */
/* Row */
.children-row {
    display: grid;
    grid-template-columns:
        1.2fr
        /* Gender */
        1.6fr
        /* Name */
        1.4fr
        /* Qualification */
        1.4fr
        /* Location */
        0.9fr
        /* Married */
        1.4fr
        /* Spouse */
        0.6fr;
    /* Action */
    gap: 12px;
    background: #ffffff;
    padding: 14px 16px;
    border-radius: 18px;
    margin-top: 12px;
    align-items: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .08);
}


/* Inputs */
.children-row input,
.children-row select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, .25);
    font-size: 14px;
    outline: none;
}

/* Disabled spouse field */
.children-row input[disabled] {
    background: #e5e7eb;
    cursor: not-allowed;
}

/* Action button */
.children-row .btn-danger {
    width: 40%;
    height: 42px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
}

/* azen */
/* hide left panel */

/* =================================================
   FULL WIDTH RIGHT PANEL – HIDE LEFT PANEL
================================================= */

/* Hide left panel completely */
.modern-form-container .form-left {
    display: none !important;
}

/* Make container single column */
.modern-form-container {
    grid-template-columns: 1fr !important;
}

/* Ensure right panel uses full width & height */
.modern-form-container .form-right {
    width: 100%;
    height: 100%;
}

/* end hide left panel */
/* =================================================
   FINAL FIX – CHILDREN SECTION OVERLAP + SCROLL
================================================= */

/* ---------- MODAL SCROLL CONTROL ---------- */
.modal-dialog.modal-xl {
    height: 90vh !important;
}

.modal-content {
    height: 100% !important;
}

.modal-body {
    height: 100% !important;
    overflow: hidden !important;
}

/* Make right panel the main scroll container */
.glass.form-right {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 60px !important;
}

/* ---------- CHILDREN SECTION SCROLL ---------- */
.children-section {
    max-height: 360px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 6px !important;
}

/* Sticky header */
.children-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

/* ---------- DESKTOP GRID FIX (NO OVERLAP) ---------- */
.children-header,
.children-row {
    display: grid !important;
    grid-template-columns:
        0.8fr
        /* Gender */
        1.4fr
        /* Name */
        0.6fr
        /* Age */
        1.3fr
        /* qualificatoin */
        1.2fr
        /* locatoin */
        1fr
        /* married status */
        1.3fr
        /* spouse name \ */
        1fr
        /* spouse age */
        1.3fr
        /* Spouse Qualification */
        1.9fr !important;
    /* Action */
    gap: 12px !important;
    align-items: center !important;
}


/* Inputs never overflow */
.children-row input,
.children-row select {
    min-width: 0 !important;
    width: 100% !important;
}

/* Action button alignment */
.children-row .btn-danger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 42px !important;
    font-size: 18px !important;
}

/* ---------- MOBILE: STACK CLEANLY ---------- */
@media (max-width: 768px) {

    /* Hide table header */
    .children-header {
        display: none !important;
    }

    /* Card-style rows */
    .children-row {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 16px !important;
    }

    .children-row input,
    .children-row select,
    .children-row button {
        width: 100% !important;
    }

    .children-row .btn-danger {
        margin-top: 6px !important;
    }
}

/* ---------- EXTRA SMALL MOBILE ---------- */
@media (max-width: 576px) {

    .children-section {
        max-height: 280px !important;
    }

    .form-actions {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .form-actions button {
        width: 100% !important;
    }
}

/* ---------- SCROLLBAR POLISH ---------- */
.children-section::-webkit-scrollbar {
    width: 6px;
}

.children-section::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
}

/* Prevent body scroll when modal open */
body.modal-open {
    overflow: hidden !important;
}
