/* Modern Styling for Applicant Information Page */
:root {
  --primary-color: #12246f;
  --secondary-color: #f8f9fa;
  --accent-color: #007bff;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --border-radius: 8px;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Unified Form Styling - Applied to all juvenile pages */
.form-control-sm, .form-select-sm {
  font-size: 0.875rem !important;
  padding: 0.25rem 0.5rem !important;
  border-radius: 0.25rem !important;
  height: calc(1.5em + 0.5rem + 2px) !important;
}

/* Ensure all form selects have rounded borders */
.form-select {
  border-radius: 0.25rem !important;
}

/* Override any material design or other CSS that might remove border-radius */
select.form-select, select.form-control {
  border-radius: 0.25rem !important;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.is-invalid {
  border-color: #dc3545;
}

.text-danger.small {
  font-size: 0.875rem;
}

body {
  background-color: #f5f7fa;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

label {
    margin-bottom: 0;
}

:is(input, select, textarea).form-control {
  background-color: white;
}

/* Progress Bar Styling */
.progress-container {
  background: white;
  padding: 20px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.progress-bar-custom {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  max-width: 200px;
}

.progress-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 15px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e9ecef;
  z-index: 1;
}

.progress-step.completed:not(:last-child)::after,
.progress-step.active:not(:last-child)::after {
  background: var(--primary-color);
}

.step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e9ecef;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  position: relative;
  z-index: 2;
  margin-bottom: 8px;
}

.progress-step.completed .step-number {
  background: var(--primary-color);
  color: white;
}

.progress-step.active .step-number {
  background: var(--accent-color);
  color: white;
}

.step-label {
  font-size: 12px;
  color: #6c757d;
  text-align: center;
}

.progress-step.completed .step-label,
.progress-step.active .step-label {
  color: var(--primary-color);
  font-weight: 500;
}

/* Sidebar Styling */
.sidebar {
  background: linear-gradient(135deg, var(--primary-color) 0%, #1e3c72 100%);
  color: white;
  min-height: 100vh;
  padding: 0;
}

.sidebar-content {
  padding: 30px 25px;
}

.logo h4 {
  color: white;
  font-weight: 600;
}

.logo i {
  color: #ffd700;
  margin-right: 10px;
}

.sidebar-steps {
  margin-top: 40px;
}

.step-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.step-link:hover {
  text-decoration: none;
  color: inherit;
}

.step-link:hover .step-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transform: translateX(5px);
}

.step-item {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
}

.step-item.completed {
  color: #90ee90;
}

.step-item.active {
  color: white;
  font-weight: 500;
}

.step-item i {
  margin-right: 12px;
  width: 20px;
  text-align: center;
}

.help-card {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.help-card h6 {
  color: white;
  margin-bottom: 10px;
}

.help-card p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  margin-bottom: 5px;
}

.help-card small {
  color: #ffd700;
  font-weight: 500;
}

/* Main Content Styling */
.main-content {
  padding: 30px;
  background: #f5f7fa;
}

.content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 30px;
}

.page-header h1 {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 5px;
}

.page-header i {
  color: var(--accent-color);
  margin-right: 10px;
}

.required::after {
    content: "*";
    color: red;
    font-weight: bold;
    font-size: 1.25rem;
    line-height: 0.65;
}

.card {
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: none;
}

.card-header {
  background: linear-gradient(135deg, #12246f 0%, #1e3a8a 100%);
  color: white;
  border-radius: 10px 10px 0 0 !important;
}

.btn-primary {
  background-color: #12246f;
  border-color: #12246f;
}

.btn-primary:hover {
  background-color: #1e3a8a;
  border-color: #1e3a8a;
}

.progress-bar {
  background-color: #12246f !important;
}

.alert-info {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  color: #495057;
}

.form-control:focus {
  border-color: #12246f;
  box-shadow: 0 0 0 0.2rem rgba(18, 36, 111, 0.25);
}

.form-select, select.form-control {
  border-radius: 0;
}

.form-select:focus {
  border-color: #12246f;
  box-shadow: 0 0 0 0.2rem rgba(18, 36, 111, 0.25);
}

/* ===== CHILDREN PAGE SPECIFIC STYLES ===== */
.child-entry {
    background-color: #f8f9fa;
    border: 2px solid #e9ecef !important;
}

/* Style for readonly select */
select[readonly], select[disabled] {
    background-color: #f8f9fa;
    opacity: 1;
    pointer-events: none;
    border: 1px solid #ced4da;
}

/* ===== BENEFICIARY PAGE SPECIFIC STYLES ===== */
/* Info Box Styling */
.info-box {
    background: #e7f3ff;
    border: 1px solid #b3d7ff;
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    align-items: flex-start;
}

.info-icon {
    color: var(--accent-color);
    margin-right: 12px;
    margin-top: 2px;
}

.info-content p {
    margin: 0;
    color: #495057;
}

/* Agreement Text Styling */
.agreement-text {
    background: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin-bottom: 20px;
}

.agreement-text p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #495057;
}

.agreement-text p:last-child {
    margin-bottom: 0;
}

/* Custom Radio/Checkbox Styling */
.custom-control-label {
    display: flex;
    align-items: center;
    padding-left: 10px;
    font-weight: 500;
}

.custom-control-label i {
    margin-right: 5px;
}

/* ===== PAYMENT PAGE SPECIFIC STYLES ===== */
/* CSS Custom Properties for Payment */
:root {
    --primary-blue: #12246f;
    --secondary-blue: #1e3a8a;
    --light-gray: #f8f9fa;
    --border-gray: #dee2e6;
    --text-muted: #6c757d;
    --warning-orange: #ffc107;
}

/* Container and Layout */
.no-gutters {
    margin-right: 0;
    margin-left: 0;
}

.no-gutters > .col,
.no-gutters > [class*="col-"] {
    padding-right: 0;
    padding-left: 0;
}

/* Custom Controls for Payment */
.custom-control {
    position: relative;
    display: block;
    min-height: 1.5rem;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
}

.custom-control-input {
    position: absolute;
    left: 0;
    z-index: -1;
    width: 1.25rem;
    height: 1.25rem;
    opacity: 0;
}

.custom-control-label {
    position: relative;
    margin-bottom: 0;
    vertical-align: top;
    font-weight: 500;
    color: #495057;
}

.custom-control-label::before {
    position: absolute;
    top: 0.125rem;
    left: -1.75rem;
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    pointer-events: none;
    content: "";
    background-color: #fff;
    border: 2px solid #adb5bd;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.custom-control-label::after {
    position: absolute;
    top: 0.125rem;
    left: -1.75rem;
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    content: "";
    background: no-repeat 50% / 50% 50%;
}

.custom-radio .custom-control-label::before {
    border-radius: 50%;
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.custom-radio .custom-control-input:checked ~ .custom-control-label::after {
    background-image: radial-gradient(circle, white 30%, transparent 30%);
}

.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='m6.564.75-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e");
}

/* Enhanced Card Styling for Payment */
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* Enhanced Button Styling for Payment */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-blue) 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(18, 36, 111, 0.3);
    color: white !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-blue) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(18, 36, 111, 0.4);
}

/* Enhanced Alert Styling for Payment */
.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease forwards;
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }

/* Mobile Responsive Styles */
@media (max-width: 767.98px) {
    /* Adjust container padding for mobile */
    .container-fluid {
        padding: 0 10px !important;
    }
    
    /* Hide sidebar on mobile or make it collapsible */
    .sidebar {
        display: none;
    }
    
    /* Make main content full width on mobile */
    .main-content {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    /* Adjust page header for mobile */
    .page-header {
        text-align: center;
        padding: 15px 0;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
        margin-bottom: 8px;
    }
    
    .page-header p {
        font-size: 0.9rem;
    }
    
    /* Form adjustments for mobile */
    .card {
        margin: 0 0 20px 0;
        border-radius: 12px;
    }
    
    .card-body {
        padding: 20px 15px;
    }
    
    /* Button adjustments for mobile */
    .btn-lg {
        padding: 12px 20px;
        font-size: 1rem;
    }
      /* Legacy button styling - kept for backward compatibility with other pages */
    @media (max-width: 575.98px) {
        .d-flex.justify-content-between:not(.nav-buttons) {
            flex-direction: column;
            gap: 15px;
        }
        
        .d-flex.justify-content-between:not(.nav-buttons) .btn {
            width: 100%;
            text-align: center;
        }
        
        /* Reverse order so Continue button appears first */
        .d-flex.justify-content-between:not(.nav-buttons) {
            flex-direction: column-reverse;
        }
    }
    
    /* Progress bar mobile adjustments */
    .progress-container {
        padding: 15px 10px;
    }
    
    .progress-step {
        font-size: 0.8rem;
        max-width: none;
        flex: 1;
    }
    
    .progress-step-number {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
        line-height: 30px;
    }
    
    .progress-step-label {
        font-size: 0.7rem;
        margin-top: 5px;
    }
    
    /* Form field spacing adjustments */
    .row.mb-3 {
        margin-bottom: 20px !important;
    }
    
    /* Ensure proper spacing between stacked form fields */
    .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-8 {
        margin-bottom: 15px;
    }
    
    /* Last column in row shouldn't have bottom margin */
    .row .col-md-2:last-child,
    .row .col-md-3:last-child,
    .row .col-md-4:last-child,
    .row .col-md-5:last-child,
    .row .col-md-6:last-child,
    .row .col-md-8:last-child {
        margin-bottom: 0;
    }
    
    /* Alert adjustments */
    .alert {
        font-size: 0.9rem;
        padding: 12px 15px;
    }
    
    /* Child entry cards mobile styling */
    .child-entry {
        padding: 15px !important;
        margin-bottom: 20px !important;
    }
    
    /* Health condition section adjustments */
    .health-child-entry {
        margin-bottom: 15px;
    }
    
    /* Total amount display */
    .alert-success h5 {
        font-size: 1.1rem;
    }
}

/* Tablet adjustments (768px to 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .main-content {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    .sidebar {
        display: none;
    }
    
    .container-fluid {
        padding: 0 20px !important;
    }
}

/* ===== NAVIGATION BUTTONS STYLING ===== */
/* Desktop navigation buttons - spaced apart in same row */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.nav-back,
.nav-next {
    flex: 0 0 auto;
}

/* Mobile navigation buttons - each button takes 50% width */
@media (max-width: 767.98px) {
    .nav-buttons {
        display: flex;
        gap: 10px;
        margin-top: 20px;
    }
    
    .nav-back,
    .nav-next {
        flex: 1;
        width: calc(50% - 5px);
    }
    
    .nav-back .button-primary,
    .nav-next .button-primary {
        width: 100%;
        text-align: center;
        margin: 0 !important;
        display: block;
        box-sizing: border-box;
    }
    
    /* Ensure empty containers still take up space */
    .nav-back:empty,
    .nav-next:empty {
        flex: 1;
        width: calc(50% - 5px);
    }
}

/* Very small screens adjustments */
@media (max-width: 575.98px) {
    .nav-buttons {
        gap: 8px;
    }
    
    .nav-back,
    .nav-next {
        width: calc(50% - 4px);
    }
    
    .nav-back .button-primary,
    .nav-next .button-primary {
        padding: 10px 12px;
        font-size: 0.85rem;
        margin: 0 !important;
    }
}

/* Back button gray styling - override button-primary colors */
.nav-back .button-primary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

.nav-back .button-primary:hover {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
    color: white !important;
}

/* Footer Styling */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer .footer-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer .div-block-9 {
    margin: 20px 0;
}

.footer .footer-label {
    color: white;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.25rem !important;
}

.footer .w-list-unstyled {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

.footer .w-list-unstyled li {
    margin-bottom: 8px !important;
    list-style: none !important;
}

.footer .footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer .footer-link:hover {
    color: white;
    text-decoration: none;
}

.footer .footer-image {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

.footer .link-block.w-inline-block {
    text-decoration: none;
}

.footer .div-block-13 {
    width: 100%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 30px 0 20px;
}

.footer .text-block-2 {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    padding: 0 20px;
}

/* Mobile Footer Responsive */
@media (max-width: 767.98px) {
    .footer .footer-menu {
        flex-direction: column;
        text-align: center;
    }
    
    .footer .link-block.w-inline-block {
        display: block !important;
        text-align: center;
        width: 100%;
        margin-bottom: 20px;
    }
    
    .footer .div-block-9 {
        margin: 15px 0;
        width: 100%;
    }
    
    .footer .footer-image {
        max-width: 150px;
        display: block;
        margin: 0 auto;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .footer .footer-menu {
        justify-content: space-between;
        align-items: flex-start;
    }
}

/* ===== JQUERY UI DATEPICKER THEME ===== */
/* Custom jQuery UI Datepicker Theme */
.ui-datepicker {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    font-family: inherit;
    font-size: 0.875rem;
    padding: 0;
    z-index: 9999 !important;
    position: absolute !important;
    color: #000000 !important;
    width: 17rem !important;
    max-width: 17rem !important;
    min-width: 17rem !important;
}

.ui-datepicker-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 0.375rem 0.375rem 0 0;
    padding: 0.75rem;
    text-align: center;
    position: relative;
}

.ui-datepicker-title {
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.ui-datepicker-prev, .ui-datepicker-next {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    height: 2rem;
    width: 2rem;
    top: 0.5rem;
    text-align: center;
    line-height: 1.8rem;
}

.ui-datepicker-prev:hover, .ui-datepicker-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ui-datepicker-prev {
    left: 0.5rem;
}

.ui-datepicker-next {
    right: 0.5rem;
}

.ui-datepicker-calendar {
    margin: 0;
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

.ui-datepicker-calendar thead th {
    background: #f8f9fa;
    color: #000000;
    font-weight: 600;
    text-align: center;
    padding: 0.375rem 0.25rem;
    border-bottom: 1px solid #dee2e6;
    width: 14.28%;
}

.ui-datepicker-calendar tbody td {
    padding: 0;
    border: none;
    text-align: center;
    width: 14.28%;
}

.ui-datepicker-calendar tbody td a {
    display: block;
    width: 100%;
    height: 2rem;
    line-height: 2rem;
    text-decoration: none;
    color: #000000;
    border-radius: 0.25rem;
    margin: 0;
    transition: all 0.15s ease-in-out;
    font-size: 0.875rem;
}

.ui-datepicker-calendar tbody td a:hover {
    background: #e9ecef;
    color: #007bff;
}

.ui-datepicker-calendar tbody td .ui-state-active {
    background: #007bff;
    color: white;
}

.ui-datepicker-calendar tbody td .ui-state-active:hover {
    background: #0056b3;
}

.ui-datepicker-calendar tbody td .ui-state-disabled {
    color: #6c757d;
    cursor: not-allowed;
}

.ui-datepicker-calendar tbody td .ui-state-disabled:hover {
    background: transparent;
    color: #6c757d;
}

.ui-datepicker-other-month {
    color: #adb5bd !important;
}

/* Month/Year dropdowns */
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.25rem;
    color: #000000;
    padding: 0.25rem;
    margin: 0 0.25rem;
}

.ui-datepicker select.ui-datepicker-month option,
.ui-datepicker select.ui-datepicker-year option {
    color: #000000;
    background: white;
}

/* Today button styling */
.ui-datepicker-buttonpane {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 0.5rem;
    text-align: center;
}

.ui-datepicker-buttonpane button {
    background: #007bff;
    border: 1px solid #007bff;
    border-radius: 0.25rem;
    color: white;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.ui-datepicker-buttonpane button:hover {
    background: #0056b3;
    border-color: #0056b3;
}

input.datepicker {
  background: white !important;
}


.custom-form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.custom-form-label.required::after {
    color: red;
    content: '*';
    font-size: 1.25rem;
    line-height: 0.65;
}

.custom-control-label.required strong::after {
    color: red;
    content: '*';
    font-size: 1.25rem;
    line-height: 0.65;
}

.header-logo img {
    max-height: 80px;
    height: auto;
    width: auto;
    object-fit: contain;
}