/* ==========================
   GLOBAL STYLES
========================== */
html, body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    height: 100%;
}

label {
    color: #3a2d52;
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
}

button {
    background-color: #eeeeee;
    color: #3a2d52;
    padding: 10px 16px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: block;
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: #ddd;
}

/* ==========================
   LAYOUT
========================== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background-color: #ffffff;
    color: #3a2d52;
    overflow-y: auto;
    transition: transform 0.3s ease;
    box-sizing: border-box;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh; /* Ensure full height */
}

.content-container {
    background-color: #f0f0f0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Important: prevents the container itself from scrolling */
}

.content-header {
    margin: 0;
    text-align: center;
    background-color: #f0f0f0;
    padding: 16px 0;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0; /* Prevents header from shrinking */
}

.content-header h1 {
    margin: 0;
    color: #3a2d52;
    font-size: 28px;
    font-weight: bold;
}

.main-content {
    flex: 1;
    padding: 16px;
    padding-bottom: 100px; /* Add space for floating button */
    overflow-y: auto;
    box-sizing: border-box;
}

/* Mobile sticky header styles */
@media (max-width: 768px) {
    .content-header {
        position: sticky;
        top: 0;
        z-index: 999;
        background-color: #f0f0f0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .content-header h1 {
        font-size: 24px;
    }

    .main-content {
        /* Remove any conflicting positioning */
        position: relative;
    }
}

.section-header {
    font-size: 18px;
    font-weight: bold;
    margin-top: 16px;
    margin-bottom: 8px;
    color: #3a2d52;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* ==========================
   NAVBAR: LOGO & HEADER
========================== */
.navbar-logo {
    text-align: center;
    margin: 10px;
}

.logo-img {
    max-width: 100%;
    max-height: 60px;
    object-fit: contain;
}

.navbar-header {
    font-weight: bold;
    padding: 8px 16px;
    border-bottom: 1px solid #ccc;
}

/* ==========================
   NAVBAR ITEMS
========================== */
.navbar-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.navbar-nav {
    flex: 1; /* Takes up remaining space */
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Scroll if nav items overflow */
}

.navbar-applications-container {
    margin: 10px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
}

.navbar-item {
    padding: 8px 16px;
    cursor: pointer;
    color: #3a2d52;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.navbar-lock-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Lock is dark by default (readable on the white sidebar); flip it white
   where the item has a dark/colored background. */
.navbar-item.selected .navbar-lock-icon,
.navbar-item:hover .navbar-lock-icon {
    filter: brightness(0) invert(1);
}

.navbar-item:hover {
    background-color: #8596c2;
    color: #ffffff;
}

.navbar-item.selected {
    background-color: #3a2d52;
    color: #ffffff;
    font-weight: bold;
}

.navbar-item.no-applications {
    color: #999;
    font-style: italic;
    cursor: default;
    background-color: transparent;
}

.navbar-item.no-applications:hover {
    background-color: transparent;
    color: #999;
}

/* ==========================
   NAVBAR ACTION BUTTONS
========================== */
.navbar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 10px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.navbar-actions button {
    background-color: #8596c2;
    color: #ffffff;
    white-space: nowrap;
}

.navbar-actions button:hover {
    background-color: #3a2d52;
}

.profile-icon, .help-icon {
    vertical-align: middle;
    margin-right: 6px;
}

.profile-icon {
    width: 15px;
    height: 15px;
}

.help-icon {
    width: 18px;
    height: 18px;
}

#profile-button, #logout-button #help-button {
    font-size: 15px;
}

/* ==========================
   HELP MODAL STYLES
========================== */
.help-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.help-modal {
    background-color: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    margin: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.help-modal h2 {
    color: #3a2d52;
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 24px;
}

.help-modal .help-content {
    color: #555;
    margin-bottom: 20px;
}

.help-modal .help-content p {
    margin-bottom: 12px;
}

.help-modal .close-button {
    background-color: #3a2d52;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    width: auto;
    float: right;
}

/* Mobile responsiveness for help modal */
@media (max-width: 768px) {
    .help-modal {
        margin: 10px;
        padding: 20px;
        max-width: calc(100vw - 20px);
    }

    .help-modal h2 {
        font-size: 20px;
    }
}

/* ==========================
   SAVE BUTTON
========================== */
.footer-button-container {
    position: fixed;
    bottom: 20px;
    left: 250px; /* Start after sidebar width */
    right: 0; /* Extend to right edge */
    display: flex;
    justify-content: center;
    gap: 16px;
    z-index: 1000;
    /* Remove the border-top and margin-top since it's now floating */
}

.footer-button-container button {
    background-color: #ccc;
    color: #555;
    border: none;
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    min-width: 150px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Add shadow for floating effect */
}

.footer-button-container button.dirty {
    background-color: #28a745;
    color: white;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3); /* Enhanced shadow for active state */
}

.footer-button-container button.dirty:hover {
    background-color: #218838;
    transform: translateY(-2px); /* Subtle hover lift effect */
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.4);
}

.footer-button-container button.purple {
    background-color: #3a2d52;
    color: white;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3); /* Enhanced shadow for active state */
}

.footer-button-container button.purple:hover {
    transform: translateY(-2px); /* Subtle hover lift effect */
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.4);
}

.footer-button-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.footer-button-container button:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile responsiveness for save button */
@media (max-width: 768px) {
    .footer-button-container {
        left: 0;
        right: 0;
        bottom: 15px;
        padding: 0 16px; /* Add horizontal padding to match main-content */
    }

    /* Hide save button when sidebar is open on mobile */
    .sidebar.open ~ .content-container .footer-button-container {
        opacity: 0;
        pointer-events: none; /* Prevent clicking when hidden */
    }

    .footer-button-container button {
        width: 100%;
    }

    .main-content {
        padding-bottom: 90px; /* Adjust for mobile button height */
    }
}

/* ==========================
   SPINNER
========================== */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #09f;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

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

/* ==========================
   HAMBURGER MENU
========================== */
.hamburger {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    cursor: pointer;
}

.hamburger-icon {
    width: 24px;
    height: 24px;
    display: block;
    transition: opacity 0.2s ease;
}

@media (min-width: 769px) {
    .hamburger {
        display: none;
    }
}

/* ==========================
   RESPONSIVE (Mobile)
========================== */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .hamburger {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }
}

/* ==========================
   APPLICATIONS PAGE
========================== */
.application-info {
    margin-bottom: 16px;
    padding: 12px 16px;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    color: #3a2d52;
}

.application-info > div {
    margin-bottom: 8px;
}

.application-info label {
    font-weight: bold;
    margin-right: 8px;
}

.application-info span {
    color: #555;
}

/* ==========================
   DESIGNATIONS TABLE
========================== */
.designations-table-container {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Grid Container for All Rows */
.designations-table-grid {
    display: grid;
    grid-template-columns: 4fr 1fr auto;
    gap: 0;
}

/* Header Row */
.designation-row.header {
    display: contents; /* Makes children participate in parent grid */
}

.designation-row.header > div {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    padding: 10px;
    font-weight: 600;
    color: #3a2d52;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* Data Rows */
.designation-row:not(.header):not(.add-row) {
    display: contents;
}

.designation-row:not(.header):not(.add-row) > div {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

/* Hover effect for entire row */
.designation-row:not(.header):not(.add-row):hover > div {
    background-color: #fafafa;
}

/* Column Specific Styling */
.school-col {
    /* Grid column 1 - takes up 2fr space */
}

.amount-col {
    /* Grid column 2 - takes up 1fr space */
}

.delete-col {
    /* Grid column 3 - takes up auto space */
    justify-content: center;
}

/* Form Elements */
.designation-row select,
.designation-row input[type="number"],
.designation-row input[type="text"] {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background-color: #ffffff;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.designation-row select:focus,
.designation-row input[type="number"]:focus,
.designation-row input[type="text"]:focus {
    outline: none;
    border-color: #3a2d52;
    box-shadow: 0 0 0 3px rgba(58, 45, 82, 0.1);
}

.designation-row select:disabled,
.designation-row input[type="number"]:disabled,
.designation-row input[type="text"]:disabled {
    background-color: #f6f8fa;
    color: #656d76;
    border-color: #d1d9e0;
    cursor: not-allowed;
}

.application-info input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.application-info input[type="text"]:focus {
    outline: none;
    border-color: #3a2d52;
    box-shadow: 0 0 0 2px rgba(58, 45, 82, 0.1);
}

.totalAmountField {
    width: 120px;
}

/* Delete Button */
.delete-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    height: 100%;
}

.delete-button:hover {
    background-color: #c82333;
}

/* Add School Row */
.designation-row.add-row {
    grid-column: 1;
    padding: 10px;
}

.add-school {
    display: flex;
    justify-content: center;
    width: 100%;
}

.add-button-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.add-button-row:hover {
    background-color: #218838;
}

.add-button-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1); /* Makes icon white */
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .designations-table-container {
        background-color: #f0f0f0;
    }

    .designations-table-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 16px;
    }

    /* Hide header on mobile */
    .designation-row.header {
        display: none;
    }

    /* Each data row becomes a card */
    .designation-row:not(.header):not(.add-row) {
        display: block;
        background-color: #ffffff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 10px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .designation-row:not(.header):not(.add-row) > div {
        padding: 0;
        border-bottom: none;
        background-color: transparent;
        margin-bottom: 12px;
        min-height: auto;
    }

    .designation-row:not(.header):not(.add-row) > div:last-child {
        margin-bottom: 0;
    }

    .delete-col {
        justify-content: flex-start;
        min-width: auto;
    }

    .add-button-row {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================
   PROFILE PAGE
========================== */
.profile-general,
.profile-login-access {
    padding: 12px 16px;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    color: #3a2d52;
}

.profile-general > div,
.profile-login-access > div {
    margin-bottom: 8px;
}

.profile-general label,
.profile-address label,
.profile-login-access label {
    font-weight: bold;
    margin-right: 8px;
}

.profile-general span,
.profile-login-access span {
    color: #555;
}

.profile-address {
    padding: 12px 16px;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    color: #3a2d52;
}

.profile-address h3 {
    margin-top: 0;
}

.profile-address > div {
    margin-bottom: 10px;
}

.profile-address input,
.profile-address select {
    width: 100%;
    padding: 6px 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.email-list {
    white-space: pre-line;
    color: #555;
    font-size: 14px;
    margin-top: 4px;
}

/* ==========================
   LOGIN PATH
========================== */
.lightbox-wrapper {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
}

.lightbox {
    background-color: #fff;
    border-radius: 12px;
    padding: 32px 24px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    text-align: center;
}

/* Responsive full-screen for mobile */
@media (max-width: 768px) {
    .lightbox-wrapper {
        align-items: flex-start;
        background-color: white;
    }

    .lightbox {
        border-radius: 0;
        max-width: none;
        width: 100%;
        height: auto;
        min-height: 100vh;
        box-shadow: none;
    }
}


/* Logo */
.lightbox-logo {
    margin-bottom: 12px;
}

.lightbox-logo .logo-img {
    margin: 0 auto;
}

.lightbox-title {
    color: #3a2d52;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 32px;
    text-align: center;
}

.field-help {
    display: block;
    font-weight: normal;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    margin-top: -10px;
    margin-bottom: 14px;
}

/* Form Elements */
.lightbox-form input,
.lightbox-form select {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    margin-top: 6px;
    margin-bottom: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.lightbox-form button {
    width: 100%;
    background-color: #8596c2;
    color: white;
    border: none;
    padding: 12px;
    font-size: 16px;
    border-radius: 6px;
}

.lightbox-form button:hover {
    background-color: #3a2d52;
}

/* Message Styling */
.lightbox-success {
    color: green;
    margin-top: 16px;
}

.lightbox-error {
    color: red;
    margin-top: 16px;
}

/* Joinder Agreement */
/* Updated Joinder Agreement Styles */
.joinder-container {
    margin: 0;
}

.joinder-intro {
    font-size: 16px;
    color: #495057;
    margin-bottom: 24px;
    padding: 16px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
}

.joinder-item {
    margin-bottom: 24px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.checkbox-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    font-size: 16px;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.joinder-checkbox {
    margin: 0;
    margin-top: 4px;
    transform: scale(1.2);
    cursor: pointer;
    flex-shrink: 0; /* Prevent checkbox from shrinking */
}

.checkbox-text {
    margin: 0;
    color: #555;
    line-height: 1.6;
    flex: 1;
    font-weight: normal;
}

.joinder-signature {
    margin: 32px 0 24px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.signature-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
}

.signature-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.signature-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.joinder-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid #dee2e6;
}

.submit-joinder-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.submit-joinder-button:hover {
    background: #218838;
}

.cancel-joinder-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cancel-joinder-button:hover {
    background: #5a6268;
}

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

    .checkbox-row {
        gap: 8px;
    }

    .joinder-actions {
        flex-direction: column;
    }

    .submit-joinder-button,
    .cancel-joinder-button {
        width: 100%;
    }
}

/* ==========================
   MODERN PROGRESS BAR
========================== */

.progress-bar-modern {
    display: flex;
}

.progress-step-modern {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 50%, calc(100% - 20px) 100%, 0 100%, 20px 50%);
    padding: 0 30px 0 35px;
    flex: 1;
    min-height: 50px;
}

/* First step - no left arrow */
.progress-step-modern:first-child {
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 50%, calc(100% - 20px) 100%, 0 100%);
    padding-left: 25px;
}

/* Last step - no right arrow */
.progress-step-modern:last-child {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 20px 50%);
    padding-right: 25px;
}

/* Single step - no arrows */
.progress-step-modern:first-child:last-child {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    padding: 0 25px;
}

.step-content {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 2;
    position: relative;
}

.step-number-modern {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    background-color: #ffffff;
    border: 2px solid currentColor;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.step-title-modern {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

/* Completed State */
.progress-step-modern.completed {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.progress-step-modern.completed .step-number-modern {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 16px;
}

/* Active State */
.progress-step-modern.active {
    background: linear-gradient(135deg, #3a2d52 0%, #5a4b7c 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(58, 45, 82, 0.4);
    animation: pulse-glow 2s infinite;
}

.progress-step-modern.active .step-number-modern {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.progress-step-modern.active .clickable {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* Pending State */
.progress-step-modern.pending {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #adb5bd;
}

.progress-step-modern.pending .step-number-modern {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #adb5bd;
}

/* Hover Effects */
.progress-step-modern:not(.pending):hover {
    transform: translateY(-3px);
}

.progress-step-modern.completed:hover {
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.progress-step-modern.active:hover {
    box-shadow: 0 10px 30px rgba(58, 45, 82, 0.5);
}


/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .progress-bar-modern {
        flex-direction: column;
        gap: 12px;
    }

    .progress-step-modern {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        padding: 16px 20px;
        min-height: 27px;
        min-width: auto;
        border-radius: 10px;
        justify-content: flex-start;
    }

    .progress-step-modern:first-child,
    .progress-step-modern:last-child,
    .progress-step-modern:first-child:last-child {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        padding: 16px 20px;
    }

    .step-number-modern {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .step-title-modern {
        font-size: 14px;
        white-space: normal;
    }

    .progress-step-modern:hover {
        transform: none;
    }

    .progress-step-modern.completed:hover,
    .progress-step-modern.active:hover {
        transform: none;
    }
}

/* ==========================
   TOAST NOTIFICATIONS
========================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none; /* Allow clicks to pass through container */
}

.toast {
    pointer-events: auto; /* Re-enable clicks on individual toasts */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.toast-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    color: white;
}

.toast-info {
    background: linear-gradient(135deg, #17a2b8 0%, #3498db 100%);
    color: white;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toast-icon {
    font-weight: bold;
    font-size: 18px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    flex-shrink: 0;
}

.toast-message {
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
}

.toast-close {
    background: none !important;
    border: none;
    color: inherit;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
    width: auto;
}

.toast-close:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .toast-container {
        top: 70px; /* Below mobile header */
        left: 16px;
        right: 16px;
        max-width: none;
    }

    .toast {
        padding: 14px;
        font-size: 14px;
    }

    .toast-icon {
        width: 20px;
        height: 20px;
        font-size: 16px;
    }

    /* Hide toasts when sidebar is open on mobile */
    .sidebar.open ~ .content-container .toast-container {
        opacity: 0;
        pointer-events: none;
    }
}

/* ==========================
   APPLY WIZARD (public /apply)
========================== */
.apply-container {
    padding: 24px 16px 64px;
    box-sizing: border-box;
    max-width: 1000px;
    margin: 0 auto;
}

.apply-logo {
    text-align: center;
    margin-bottom: 16px;
}

.apply-progress {
    margin-bottom: 24px;
}

/* Keep apply-wizard steps still when selected/hovered (no vertical shift). */
.apply-progress .progress-step-modern,
.apply-progress .progress-step-modern.active,
.apply-progress .progress-step-modern.completed,
.apply-progress .progress-step-modern.pending,
.apply-progress .progress-step-modern:hover,
.apply-progress .progress-step-modern:not(.pending):hover {
    transform: none;
    animation: none;
}

/* Non-pending steps are navigable. */
.apply-progress .progress-step-modern.completed,
.apply-progress .progress-step-modern.active {
    cursor: pointer;
}

.apply-progress .progress-step-modern.pending {
    cursor: default;
}

.apply-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.apply-card h2 {
    color: #3a2d52;
    margin-top: 0;
}

.apply-intro {
    font-size: 15px;
    color: #495057;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    white-space: pre-line;
}

.apply-field {
    margin-bottom: 16px;
}

.apply-field > label {
    display: block;
    font-weight: bold;
    color: #3a2d52;
    margin-bottom: 6px;
}

.apply-field .field-desc {
    font-weight: normal;
    color: #6c757d;
    font-size: 13px;
    display: block;
    margin-top: 2px;
}

.apply-field input[type="text"],
.apply-field input[type="email"],
.apply-field input[type="tel"],
.apply-field input[type="number"],
.apply-field select {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    box-sizing: border-box;
    font-family: inherit;
    background: #fff;
    color: #333;
}

.apply-field input.invalid,
.apply-field select.invalid {
    border-color: #dc3545;
}

.apply-error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 4px;
}

.req {
    color: #dc3545;
    margin-left: 3px;
    font-weight: bold;
}

.apply-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.apply-check input {
    margin-top: 4px;
    transform: scale(1.2);
    flex-shrink: 0;
}

.apply-check label {
    font-weight: normal;
    color: #555;
    line-height: 1.5;
    margin: 0;
}

.apply-radio-group label {
    font-weight: normal;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.apply-total {
    font-size: 18px;
    font-weight: 600;
    color: #3a2d52;
    text-align: right;
    margin: 12px 4px;
}

.apply-total.short {
    color: #dc3545;
}

.apply-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.apply-nav button {
    width: auto;
    min-width: 130px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
}

.apply-nav .btn-next,
.apply-nav .btn-submit {
    background: #3a2d52;
    color: #fff;
    margin-left: auto;
}

.apply-nav .btn-next:hover,
.apply-nav .btn-submit:hover {
    background: #2c2140;
}

.apply-nav .btn-submit:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

.apply-nav .btn-back {
    background: #eee;
    color: #3a2d52;
}

.apply-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.apply-summary-row .label {
    font-weight: 600;
    color: #3a2d52;
}

/* Cancel/logout link on its own line below the nav. */
.apply-logout {
    margin-top: 16px;
}

.btn-cancel-logout {
    width: auto;
    min-width: 0;
    background: none;
    color: #6c757d;
    text-decoration: underline;
    font-size: 14px;
    font-weight: normal;
    padding: 8px 4px;
}

.btn-cancel-logout:hover {
    background: none;
    color: #dc3545;
}

.apply-member-login {
    margin-top: 6px;
    padding-left: 4px;
    font-size: 14px;
    color: #6c757d;
}

.apply-member-login a {
    color: #3a2d52;
    font-weight: 600;
}

.apply-footer {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    color: #555;
    font-size: 14px;
    text-align: center;
}

.apply-footer strong {
    color: #3a2d52;
}

.apply-footer p {
    margin: 8px 0 0;
    line-height: 1.6;
}
