@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --primary-blue: #c00000; /* Main brand blue */
    --primary-blue-dark: #560909; /* Darker for hover */
    --accent-light-blue: #e6f3ff; /* Very light blue for active states */
    --text-color-dark: #333;
    --text-color-medium: #555;
    --text-color-light: #888;
    --border-color-light: #e0e0e0;
    --border-color-medium: #ccc;
    --background-light: #fdfdfd;
    --background-grey: #f8f9fa;
    --error-red: #d9534f; /* A slightly softer red */
    --success-green: #5cb85c;

    /* Shadows */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 15px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 40px;

    /* Border Radius */
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 16px;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: 'Poppins', sans-serif;
    color: var(--text-color-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

body {
    background: linear-gradient(135deg, #f0f4f8, #e0e7ee); /* Subtle gradient */
    background-color: var(--background-grey); /* Fallback */
    display: flex;
    justify-content: center;
    align-items: center;
    height: fit-content;
    padding: var(--spacing-md);
}

/* Main Container & Card */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: fit-content;
    max-width: 1200px;
    max-height: 800px; /* Constrain max height */
}

.card {
    display: flex;
    width: 100%;
    height: 100%;
    background-color: var(--background-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 300px; /* Slightly wider sidebar */
    background-color: var(--background-light); /* Matching card background for seamless look */
    padding: var(--spacing-xl) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border-right: 1px solid var(--border-color-light);
    flex-shrink: 0; /* Prevent shrinking on smaller screens */
}

.sidebar-logo {
    max-width: 180px; /* Larger logo */
    height: auto;
    margin-bottom: var(--spacing-xl);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05)); /* Subtle shadow for logo */
}

.steps-list {
    list-style: none;
    width: 100%;
}

.steps-list li {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-xs); /* Padding for clickable area */
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-color-medium);
    font-weight: 500;
}

.steps-list li:hover:not(.active) {
    background-color: rgba(10, 115, 184, 0.05); /* Very light blue hover */
    color: var(--primary-blue);
}

.steps-list li .circle {
    width: 40px; /* Larger circle */
    height: 40px;
    border-radius: 50%;
    background-color: var(--border-color-medium);
    color: var(--text-color-light);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px; /* Larger number */
    font-weight: 600;
    margin-right: var(--spacing-md);
    border: 2px solid var(--border-color-medium);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.steps-list li .label {
    font-size: 16px; /* Slightly larger label */
    white-space: nowrap; /* Prevent label from wrapping */
}

.steps-list li.active {
    background-color: var(--accent-light-blue);
    color: var(--primary-blue);
    font-weight: 600;
}

.steps-list li.active .circle {
    background-color: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-sm); /* Subtle shadow for active circle */
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Allow scrolling for form content */
}

#step-title {
    font-size: 32px; /* Larger title */
    font-weight: 700;
    color: var(--text-color-dark);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-sm); /* Adds subtle space above border */
    border-bottom: 1px solid var(--border-color-light);
    animation: fadeIn 0.5s ease-out; /* Fade in title on step change */
}

/* Form Fields Layout */
.form-area {
    flex-grow: 1;
    padding-right: 15px; /* Space for potential scrollbar */
    margin-bottom: var(--spacing-lg); /* Space before footer */
}

.fields {
    display: grid;
    gap: var(--spacing-lg) var(--spacing-xl); /* Generous spacing */
    padding-bottom: var(--spacing-lg); /* Space below the last field before footer */
}

.fields.two-col {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Adjusted min-width for columns */
}

.fields .full-col {
    grid-column: 1 / -1;
}
.fields .checkbox{
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);

}

/* Individual Form Labels and Inputs */
.form-label {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    color: var(--text-color-medium);
    font-weight: 500;
    line-height: 1.4;
}

.form-label input:not([type="radio"]),
.form-label textarea,
.form-label select {
    width: 100%;
    padding: 12px 16px; /* Increased padding */
    border: 1px solid var(--border-color-medium);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    background-color: var(--background-light);
    color: var(--text-color-dark);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    margin-top: var(--spacing-xs);
    font-family: 'Poppins', sans-serif;
    outline: none; /* Remove default outline */
}

input:not([type="radio"]):focus,
textarea:focus,
select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(10, 115, 184, 0.2);
    background-color: #fff; /* Ensure white background on focus */
}

textarea {
    resize: vertical;
    min-height: 120px; /* More space for textareas */
}

/* File Input Custom Styling (basic, can be enhanced with JS) */
input[type="file"] {
    background-color: var(--background-grey); /* Slightly different bg for file input */
    cursor: pointer;
}
input[type="file"]::file-selector-button {
    background-color: var(--primary-blue);
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    margin-right: 15px;
    transition: background-color 0.2s ease;
}
input[type="file"]::file-selector-button:hover {
    background-color: var(--primary-blue-dark);
}

.file-url-display {
    font-size: 12px;
    color: var(--text-color-light);
    margin-top: 5px;
    word-break: break-all; /* Break long URLs */
}

label a{
    color: var(--primary-blue);
    text-decoration: underline;
    font-weight: 500;
}

/* Radio Button Styling (Enhanced) */
.package-options,
.payment-options {
    display: flex;
    flex-direction: column; /* Stack radio options */
    gap: 12px; /* Spacing between options */
}

.package-options label,
.payment-options label {
    display: flex;
    align-items: center;
    font-size: 16px;
    color: var(--text-color-dark);
    cursor: pointer;
    user-select: none; /* Prevent text selection on click */
    padding: 8px 0; /* Add vertical padding for better click area */
}

.package-options input[type="radio"],
.payment-options input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 22px; /* Slightly larger radio button */
    height: 22px;
    border: 2px solid var(--border-color-medium);
    border-radius: 50%;
    margin-right: var(--spacing-sm);
    display: inline-block;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.package-options input[type="radio"]:checked,
.payment-options input[type="radio"]:checked {
    border-color: var(--primary-blue);
    background-color: var(--accent-light-blue); /* Light blue fill when checked */
}

.package-options input[type="radio"]:checked::before,
.payment-options input[type="radio"]:checked::before {
    content: '';
    width: 10px;
    height: 10px;
    background-color: var(--primary-blue);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: background-color 0.2s ease;
}

/* Payment Summary */
.payment-summary {
    background-color: var(--background-grey);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    margin-top: var(--spacing-lg);
    border: 1px solid var(--border-color-light);
}

.payment-summary h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color-dark);
    margin-bottom: var(--spacing-xs);
}

.payment-summary h3 span {
    color: var(--primary-blue);
    font-weight: 700;
}


/* Footer & Buttons */
.footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color-light);
    margin-top: auto; /* Push footer to the bottom of main-content */
}

.footer button {
    padding: 12px 30px; /* More generous padding */
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm); /* Subtle shadow for buttons */
}

.footer button.prev {
    background-color: var(--background-grey);
    color: var(--text-color-medium);
}

.footer button.prev:hover:not(:disabled) {
    background-color: #e6e9ed;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.footer button.next,
.footer button.submit {
    background-color: var(--primary-blue);
    color: white;
}

.footer button.next:hover:not(:disabled),
.footer button.submit:hover:not(:disabled) {
    background-color: var(--primary-blue-dark);
    transform: translateY(-1px); /* Slight lift effect */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.footer button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* Validation Styling */
input.invalid, textarea.invalid {
    border-color: var(--error-red) !important; /* Override focus styles */
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2) !important;
}

/* Specific for radio groups if invalid */
.invalid-group {
    border: 1px solid var(--error-red); /* Highlight the container of the radio group */
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-sm);
    margin-top: var(--spacing-xs);
    animation: shake 0.5s; /* Add shake animation to the group */
}

/* Loading Overlay & Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px); /* Subtle blur effect */
    -webkit-backdrop-filter: blur(5px);
    display: none; /* Hidden by default, correctly toggled by JS */
}

.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary-blue); /* Make sure --primary-blue is defined elsewhere, or use a color like 'blue' for testing */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite; /* This calls the animation */
    margin-bottom: 20px;
}

/* --- ADD THIS KEYFRAMES RULE --- */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* ------------------------------- */
.notification-popup {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  color: black;
  border: 2px solid #4CAF50;
  padding: 20px 30px;
  border-radius: 10px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.25);
  z-index: 10000;
  display: none;
  text-align: center;
}

.notification-popup.error {
  border-color: #f44336;
}

.notification-popup.success {
  border-color: #4CAF50;
}

.notification-popup button {
  margin-top: 15px;
  background-color: #0A73B8;
  color: white;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 5px;
}

.hidden {
  display: none;
}

/* Overlay background */
.overlaypolicy {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Modal content */
.policy {
  background: white;
  padding: 30px;
  border-radius: 10px;
  max-width: 100%;
  max-height: 100dvh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}


/* Responsive Adjustments */
@media (max-width: 1024px) {
    body {
        padding: var(--spacing-sm);
    }
    .container {
        max-height: unset; /* Allow height to adjust */
        height: auto;
    }
    .card {
        flex-direction: column;
        height: auto; /* Card adjusts height */
        overflow-y: auto; /* Allow scrolling for the entire card */
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color-light);
        padding: var(--spacing-md) var(--spacing-lg);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap; /* Allow logo and steps to wrap */
    }
    .sidebar-logo {
        margin-bottom: 0;
        max-width: 150px;
    }
    .steps-list {
        display: none; /* Hide steps list on smaller screens */
    }

    .main-content {
        padding: var(--spacing-lg);
    }
    #step-title {
        font-size: 28px;
        margin-bottom: var(--spacing-lg);
    }
    .fields {
        gap: var(--spacing-md);
    }
    .footer {
        padding-top: var(--spacing-md);
        margin-top: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    body {
        padding: var(--spacing-xs);
    }
    .main-content {
        padding: var(--spacing-md);
    }
    .fields.two-col {
        grid-template-columns: 1fr; /* Single column on very small screens */
    }
    .footer {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    .footer button {
        width: 100%;
        padding: 10px 20px;
        font-size: 16px;
    }
    .sidebar {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    .sidebar-logo {
        margin-bottom: 0;
        max-width: 120px;
    }
}