.form-master-container {
    max-width: 1200px;
    margin: 0px auto;
    font-family: 'Alilato', Arial, sans-serif;
    background: #fff;
    padding: 50px 80px;
}

/* Toggle Switch */
.form-toggle-section { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 40px; }
.toggle-label { font-weight: 600; color: #555; font-size: 1.1rem; }
.form-switch { position: relative; display: inline-block; width: 46px; height: 22px; }
.form-switch input { opacity: 0; width: 0; height: 0; }
.form-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #d84a4a; transition: .4s; border-radius: 34px; }
.form-slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .form-slider:before { transform: translateX(24px); }

/* Progress Bar & Tab Labels */
.progress-container {
    width: 100%;
    margin-bottom: 40px;
}

/* The light gray track */
.progress-bar-track {
    height: 14px;
    background-color: #d9dee3; /* Accurate Figma gray */
    border-radius: 20px;
    position: relative;
    overflow: hidden; /* Clips the red fill to the track's rounded corners */
}

/* The red fill */
.progress-bar-fill {
    height: 100%;
    background-color: #d84a4a; /* Accurate Figma red */
    width: 12.5%; /* Default for Step 1 (100 / 8) */
    border-radius: 20px;
    transition: width 0.4s ease-in-out;
}

/* Flex container for labels to prevent overlapping */
.progress-steps-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}
.step-label {
    flex: 1;
    text-align: center;
    font-size: 15px;
    color: #393738;
    line-height: 1.2;
    padding: 0;
    white-space: normal;
    letter-spacing: 0.2px;
    font-weight: 600;
}
/* Figma active state: darker and bold */
.step-label.active {
    font-weight: 600;
    color: #000;
}

/* Ensure the first and last labels align with the bar ends */
.step-label:first-child { text-align: left; padding-left: 0; }
.step-label:last-child { text-align: right; padding-right: 0; }
/* Section Boxes (The "Tabular" Card Look) */
.section-box { 
    background: #f6f6f6; /* Light gray background from Figma */
    border: 1px solid #e9ecef; 
    padding: 40px; 
    text-align: left; 
    margin-bottom: 25px; 
    border-radius: 4px;
}
.section-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
    border-bottom: 1px solid #dee2e6; 
    padding-bottom: 15px; 
}
.section-box h3 {
    margin: 0;
    font-size: 20px !important;
    color: #636363 !important;
    font-weight: 700;
    letter-spacing: 0.5px;
    -webkit-text-stroke: thin;
    -webkit-text-stroke-color: #636363;
}
.required-notice { color: #d84a4a; font-size: 0.85rem; }

/* Form Elements Styling */
.form-title { font-size: 2.2rem; color: #393738; margin-bottom: 15px; font-weight: 600; text-align: center;letter-spacing: 0.6px; }
.form-subtitle {
    color: #555;
    line-height: 1.7;
    margin-bottom: 40px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.1px;
}
.field-group { margin-bottom: 20px; display: flex; flex-direction: column; }
.field-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 17px;
    letter-spacing: 0.4px;
}
input, select, textarea {
    /* padding: 14px 18px; */
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem !important;
    width: 100%;
    box-sizing: border-box;
    background-color: #fff;
    color: #636363;
    font-family: inherit;
}
input::placeholder { color: #adb5bd; }
select { appearance: none; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M7%2010l5%205%205-5z%22/%3E%3C/svg%3E'); background-repeat: no-repeat; background-position: right 15px center; }

/* Grid Layouts */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.form-row-tri { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* Buttons */
.submit-button {
    background-color: #d84a4a;
    color: white;
    border: none;
    padding: 16px 50px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1.7px;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 0;
    text-transform: uppercase;
    /* float: right; */
    margin-left: auto;
}
.submit-button:hover, .submit-button:focus { background-color: #c51b2f !important; }

.back-button{
	    background: #fff;
    color: #d32e2f;
    border: 1px solid #d32e2f;
    border-radius: 0;
}
.back-button:hover,  #referral-back-btn:hover{
 background: #c51b2f !important;
    color: #fff !important;
    border: 1px solid #d32e2f !important;
    border-radius: 0;
}

#referral-back-btn:focus{
	  background: #fff !important;
    color: #d32e2f !important;
    border: 1px solid #d32e2f !important;
    border-radius: 0;
	
}
.form-footer-right {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Success Message Box */
.success-message-box {
    background-color: #f8f9fa;
    padding: 40px 40px;
    border-radius: 4px;
    text-align: center;
}
.success-message-box h3 {
    font-size: 23px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #636363;
    -webkit-text-stroke-color: #636363;
    -webkit-text-stroke-width: 0.5px;
    letter-spacing: 0.5px;
}
.success-message-box p {
    color: #636363;
    font-size: 22px;
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.8px;
}

/* Error Handling */
.input-error { border-color: #d0293d !important; }
.field-error {
    color: #d0293d;
    font-size: 15px !important;
    margin-top: 5px;
   
	font-weight: 600;
}

/* Form Layout */
.section-box { border: 1px solid #eee; border-radius: 4px; padding: 30px; margin-bottom: 30px; position: relative; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: unset;
    margin-bottom: 20px;
    padding-bottom: 20px;
}
.section-box h3 { margin: 0; font-size: 18px; color: #333; }
.required-notice span {
    color: #d84a4a !important;
    font-size: 20px;
    font-weight: 600;
    margin-right: 5px;
}
.required-notice {
    color: #6e6f71;
    font-size: 17px;
    font-weight: 600;
}

/* Shaded Conditional Boxes */
.conditional-shaded-box { 
    background: #D3D4D9; padding: 25px; border-radius: 4px; 
    margin-top: 15px; margin-bottom: 20px; 
}

/* Fields Styling */
.field-group { margin-bottom: 20px; }
.field-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.4px;
}
.styled-form input, .styled-form select, .referral-accordion-header {
    width: 100%;
    padding: 0 27px !important;
    border: 1px solid #D3D4D9;
    border-radius: 0;
    font-size: 18px !important;
    height: 55px;
    color: #636363;
    font-weight: 600;
    letter-spacing: 0.4px;
    background: #fff;
}
.styled-form input:focus, .styled-form select:focus, .styled-form textarea:focus{
	outline:none;
	border: 1px solid #D3D4D9;
}
.styled-form input::placeholder {
	color: #636363
}
.styled-form input[type="date"] {
    position: relative;
    background-image: url('https://cdn-icons-png.flaticon.com/512/2838/2838779.png') !important;
    background-repeat: no-repeat !important;
    background-position: right 20px center !important;
    background-size: 18px !important;
}

/* This targets the specific 'webkit' calendar picker indicator */
input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    color: transparent;
    background: transparent;
    cursor: pointer;
}
.form-row-tri { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* Checkbox Grid */
.checkbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 15px; }
.checkbox-item { display: flex; align-items: center; font-size: 14px; }
.checkbox-item input { width: auto; margin-right: 10px; }


/* Accordion Header Bar */
.referral-accordion-header {
    border: 1px solid #ccc;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #fff;
    border-radius: 4px;
    font-size: 15px;
    color: #666;
}

/* Collapsible Body */
.referral-accordion-body {
    border: 1px solid #ccc;
    border-top: none;
    padding: 25px;
    background: #fff;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* Three Column Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.checkbox-item {
    display: flex !important;
    align-items: center;
    font-size: 17px !important;
    color: #636363 !important;
    margin-bottom: 15px;
    cursor: pointer;
}

.checkbox-item input {
    margin-right: 12px;
    width: 32px;
    height: 32px;
    accent-color: #d84a4a;
    /* appearance: none !important; */
    -webkit-appearance: none !important;
    aspect-ratio: 1/1;
    border: 1px solid #D3D4D9;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    /* max-width: 25px; */
    padding: 0 !important;
}
/* 3. Style the "Checked" state border */
.checkbox-item input:checked {
  background-color: #d0283c !important;
  border-color: #d0283c !important;
	outline: none !important
}
.checkbox-item input:checked::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 2px;
    width: 10px;
    height: 20px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.conditional-shaded-box label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}
.conditional-shaded-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    background: #fff !important;
}

/* Add Another Expert Button */
.add-another-link {
    background: none;
    border: none;
    color: #d84a4a;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    padding: 10px 0;
    display: inline-block;
    text-decoration: none;
}

.add-another-link:hover, .add-another-link:focus {
    text-decoration: none;
    background: transparent;
    color: #c51b2f;
    box-shadow: none !important;
}

/* Ensure expert inputs are white inside gray box */
.expert-entry input {
    background: #ffffff !important;
}

/* Textarea Styling */
textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical; /* Allows user to expand height if needed */
    background-color: #fff;
}

textarea:focus {
    border-color: #d84a4a; /* Matches brand red */
    outline: none;
}
 select {
    appearance: none !important;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' 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") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 1.5em !important;
   
}


@media (max-width: 768px){
.form-row-tri, .checkbox-grid {
    grid-template-columns: 1fr;
    gap: 0;
}
	
	.form-master-container {
   
		padding: 50px 20px;
	}
	.progress-steps-labels{
   
   display: none
}
	
	.section-box {
    
    padding: 20px;
   
}
	
	.styled-form input, .styled-form select, .referral-accordion-header {
   
    padding: 0 17px !important;
    border: 1px solid #D3D4D9;
  
    font-size: 14px !important;
    height: 47px;
    color: #636363;
    
}

}
