/* ========================================
   PMYB&ALS Application Form — Stylesheet
   Government Green Theme, Fully Responsive
   ======================================== */

/* ---------- Reset & Base ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Nastaliq+Urdu:wght@400;700&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --green-primary: #1a7e34;
    --green-dark: #156b2b;
    --green-light: #4faf65;
    --green-gradient: linear-gradient(135deg, #4faf65, #1a7e34);
    --green-gradient-h: linear-gradient(90deg, #4faf65, #1a7e34);
    --gold: #c89b3c;
    --gold-light: #d4a84a;
    --white: #ffffff;
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --text-dark: #1a1a2e;
    --text-mid: #444;
    --text-light: #666;
    --text-muted: #999;
    --border: #dde1e6;
    --border-light: #e8ecf0;
    --red: #dc3545;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.urdu-text {
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
    direction: rtl;
    text-align: right;
    line-height: 2;
}

/* ---------- Header ---------- */
.header {
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-link img {
    height: 50px;
    width: auto;
}

/* Desktop Navigation */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-desktop li a {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-desktop li a:hover {
    background: rgba(26, 126, 52, 0.08);
    color: var(--green-primary);
}

/* Menu Grid Button */
.menu-grid-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: grid;
    grid-template-columns: repeat(3, 6px);
    grid-template-rows: repeat(3, 6px);
    gap: 3px;
    align-content: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
    flex-shrink: 0;
}

.menu-grid-btn span {
    width: 6px;
    height: 6px;
    background: var(--text-mid);
    border-radius: 50%;
    transition: var(--transition);
}

.menu-grid-btn:hover {
    background: rgba(26, 126, 52, 0.08);
}

.menu-grid-btn:hover span {
    background: var(--green-primary);
}

/* Mobile Hamburger */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 8px;
}

.mobile-menu-btn span {
    width: 22px;
    height: 2.5px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav Drawer */
.mobile-nav {
    display: none;
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    z-index: 999;
    overflow-y: auto;
    padding: 16px 20px;
    animation: slideDown 0.3s ease;
}

.mobile-nav.show {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-nav ul {
    list-style: none;
}

.mobile-nav ul li a {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
}

.mobile-nav ul li a:hover,
.mobile-nav ul li a:active {
    background: rgba(26, 126, 52, 0.06);
    color: var(--green-primary);
}

/* ---------- Main Content Container ---------- */
.main-content {
    max-width: 1200px;
    width: 100%;
    margin: 24px auto;
    padding: 0 16px;
    flex: 1;
}

/* ---------- Form Card ---------- */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* Green Title Bar */
.form-title-bar {
    background: var(--green-gradient-h);
    padding: 16px 24px;
    text-align: center;
}

.form-title-bar h1 {
    color: var(--white);
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.3px;
}

/* ---------- Info Section (bilingual) ---------- */
.info-section {
    display: flex;
    align-items: flex-start;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border-light);
}

.info-english {
    flex: 1;
}

.info-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-logo img {
    width: 100px;
    height: auto;
}

.info-urdu {
    flex: 1;
}

.info-english ul,
.info-urdu ul {
    list-style: disc;
    padding-left: 20px;
}

.info-urdu ul {
    padding-left: 0;
    padding-right: 20px;
}

.info-english li {
    font-size: 13px;
    color: var(--text-mid);
    margin-bottom: 6px;
    line-height: 1.6;
}

.info-urdu li {
    font-size: 14px;
    color: var(--text-mid);
    margin-bottom: 6px;
    line-height: 2;
}

/* ---------- Buttons Row ---------- */
.buttons-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    white-space: nowrap;
}

.btn-instructions {
    background: var(--green-gradient-h);
    color: var(--white);
    border: none;
    padding: 12px 60px;
    font-size: 16px;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(26, 126, 52, 0.3);
    width: 100%;
    max-width: 500px;
}

.btn-instructions:hover {
    box-shadow: 0 5px 20px rgba(26, 126, 52, 0.4);
    transform: translateY(-1px);
}

.btn-outline-green {
    background: transparent;
    color: var(--green-primary);
    border: 2px solid var(--green-primary);
}

.btn-outline-green:hover {
    background: var(--green-primary);
    color: var(--white);
}

.btn-outline-gold {
    background: var(--gold);
    color: var(--white);
    border: 2px solid var(--gold);
}

.btn-outline-gold:hover {
    background: var(--gold-light);
    border-color: var(--gold-light);
}

.btn-outline-dark {
    background: var(--text-dark);
    color: var(--white);
    border: 2px solid var(--text-dark);
}

.btn-outline-dark:hover {
    background: #2a2a3e;
    border-color: #2a2a3e;
}

/* ---------- Form Section ---------- */
.form-section {
    padding: 28px 24px;
}

.form-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-group label .required {
    color: var(--red);
    margin-left: 2px;
}

.form-group label .urdu-label {
    float: right;
    font-family: 'Noto Nastaliq Urdu', serif;
    font-weight: 400;
    font-size: 13px;
    color: var(--text-light);
    direction: rtl;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
    font-size: 13px;
}

.form-control:focus {
    border-color: var(--green-primary);
    box-shadow: 0 0 0 3px rgba(26, 126, 52, 0.12);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.validation-error {
    color: var(--red);
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.validation-error.show {
    display: block;
}

.btn-enter {
    background: var(--green-primary);
    color: var(--white);
    border: none;
    padding: 10px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
    height: 42px;
}

.btn-enter:hover {
    background: var(--green-dark);
    box-shadow: 0 3px 12px rgba(26, 126, 52, 0.3);
    transform: translateY(-1px);
}

.btn-enter:active {
    transform: translateY(0);
}

/* ---------- MFI Table Image Section ---------- */
.mfi-section {
    padding: 16px;
    text-align: center;
    border-top: 1px solid var(--border-light);
}

.mfi-section img {
    max-width: 28%;
    height: auto;
    border-radius: var(--radius);
}

/* ---------- Footer ---------- */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border-light);
    padding: 20px;
    text-align: center;
    margin-top: auto;
}

.footer p {
    font-size: 13px;
    color: var(--text-light);
    margin: 0;
}

.footer a {
    color: var(--green-primary);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

/* ---------- Modal Overlay ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    background: var(--green-gradient-h);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h3 {
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
}

.modal-header .urdu-title {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 16px;
    margin-left: 16px;
}

.modal-close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: rgba(255,255,255,0.35);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body .instruction-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.modal-body .instruction-item:last-child {
    border-bottom: none;
}

.modal-body .instruction-item .eng {
    flex: 1;
    font-size: 13.5px;
    color: var(--text-mid);
    line-height: 1.6;
}

.modal-body .instruction-item .urd {
    flex: 1;
    font-family: 'Noto Nastaliq Urdu', serif;
    direction: rtl;
    text-align: right;
    font-size: 14px;
    color: var(--text-mid);
    line-height: 2;
}

.modal-body .note-section {
    background: #e8e8e8;
    padding: 10px 16px;
    border-radius: 6px;
    margin: 16px 0;
    display: flex;
    justify-content: space-between;
}

.modal-body .note-section .eng-note {
    font-weight: 700;
    font-size: 14px;
}

.modal-body .note-section .urd-note {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-weight: 700;
    font-size: 14px;
    direction: rtl;
}

.modal-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    flex-shrink: 0;
}

.btn-modal-close {
    background: transparent;
    color: var(--green-primary);
    border: 2px solid var(--green-primary);
    padding: 8px 32px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-modal-close:hover {
    background: var(--green-primary);
    color: var(--white);
}

/* Edit Application Modal */
.edit-modal .modal-box {
    max-width: 500px;
}

.edit-form-group {
    margin-bottom: 16px;
}

.edit-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.btn-submit-modal {
    background: var(--green-primary);
    color: var(--white);
    border: none;
    padding: 10px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-right: 8px;
}

.btn-submit-modal:hover {
    background: var(--green-dark);
}

.btn-close-modal {
    background: #6c757d;
    color: var(--white);
    border: none;
    padding: 10px 28px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-close-modal:hover {
    background: #5a6268;
}

/* ---------- Alert / Info Modal ---------- */
.alert-modal .modal-box {
    max-width: 600px;
}

.alert-modal .modal-body {
    text-align: center;
}

.alert-modal .modal-body img {
    max-width: 100%;
    border-radius: 8px;
}

.alert-modal .btn-info-close {
    background: #17a2b8;
    color: var(--white);
    border: none;
    padding: 8px 24px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 12px;
    transition: var(--transition);
}

.alert-modal .btn-info-close:hover {
    background: #138496;
}

/* Dear Applicants notice modal */
.notice-modal .modal-box {
    max-width: 650px;
}

.notice-list {
    list-style: disc;
    padding-left: 24px;
    text-align: left;
}

.notice-list li {
    font-size: 14px;
    color: var(--text-mid);
    margin-bottom: 8px;
    line-height: 1.6;
}

.notice-list li .highlight-green {
    color: var(--green-primary);
    font-weight: 700;
}

.notice-list li.note-red {
    color: var(--red);
    font-weight: 500;
}

/* Meezan Bank modal */
.bank-modal .modal-box {
    max-width: 500px;
}

.bank-modal .modal-header {
    background: #dcdcdc;
}

.bank-modal .modal-header h3 {
    color: var(--green-primary);
}

.bank-modal .modal-body p {
    font-size: 14px;
    color: var(--text-mid);
    margin-bottom: 8px;
}

.bank-modal .modal-body .urd-p {
    font-family: 'Noto Nastaliq Urdu', serif;
    direction: rtl;
    text-align: right;
    line-height: 2;
}

/* ---------- Toast Notification ---------- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--white);
    border-left: 4px solid var(--green-primary);
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    font-size: 14px;
    min-width: 280px;
    animation: toastIn 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toast.error {
    border-left-color: var(--red);
}

.toast.success {
    border-left-color: var(--green-primary);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    margin-left: 12px;
}

/* ---------- Loading Overlay ---------- */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.85);
    z-index: 5000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--border);
    border-top-color: var(--green-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    margin-top: 14px;
    font-size: 14px;
    color: var(--text-mid);
    font-weight: 500;
}

/* ========================================
   RESPONSIVE — Tablet (max-width: 992px)
   ======================================== */
@media (max-width: 992px) {
    .nav-desktop {
        display: none;
    }

    .menu-grid-btn {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .info-section {
        flex-direction: column;
        gap: 16px;
    }

    .info-logo {
        order: -1;
        align-self: center;
    }

    .info-logo img {
        width: 80px;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .form-group {
        min-width: 100%;
    }

    .btn-enter {
        width: 100%;
        margin-top: 4px;
    }

    .buttons-row {
        flex-direction: column;
        gap: 10px;
    }

    .btn-instructions {
        max-width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

/* ========================================
   RESPONSIVE — Mobile (max-width: 576px)
   ======================================== */
@media (max-width: 576px) {
    html {
        font-size: 15px;
    }

    .header-inner {
        padding: 6px 12px;
    }

    .logo-link img {
        height: 40px;
    }

    .main-content {
        margin: 12px auto;
        padding: 0 8px;
    }

    .form-card {
        border-radius: var(--radius);
    }

    .form-title-bar {
        padding: 12px 16px;
    }

    .form-title-bar h1 {
        font-size: 17px;
    }

    .info-section {
        padding: 16px;
    }

    .info-english li {
        font-size: 12px;
    }

    .info-urdu li {
        font-size: 13px;
    }

    .buttons-row {
        padding: 14px 16px;
    }

    .form-section {
        padding: 18px 16px;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }

    .mfi-section {
        padding: 8px 0;
    }

    .mfi-section img {
        max-width: 100%;
        width: 100%;
    }

    .modal-box {
        max-height: 92vh;
        border-radius: var(--radius);
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-header h3 {
        font-size: 15px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-body .instruction-item {
        flex-direction: column;
        gap: 6px;
    }

    .footer {
        padding: 14px 12px;
    }

    .footer p {
        font-size: 12px;
    }

    .toast {
        min-width: auto;
        width: calc(100vw - 40px);
    }
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-danger { color: var(--red); }
.d-none { display: none; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
