/* Accordion styles */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
    padding: 0 1.5rem;
}
.accordion-content.show {
    padding: 1.5rem 1.5rem;
}
.accordion-button::after {
    content: '\25BC'; /* Down arrow */
    float: right;
    transition: transform 0.3s;
}
.accordion-button.open::after {
    transform: rotate(180deg); /* Up arrow */
}

body { 
    font-family: 'Inter', sans-serif; 
}

.gradient-bg { 
    background: linear-gradient(135deg, #3b82f6, #8b5cf6); 
}

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

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

:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

#calculation-explanation {
    transition: opacity 0.4s ease-in-out;
    opacity: 0;
}

#calculation-explanation.visible {
    opacity: 1;
}

.radio-toggle:checked + label {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.hidden-section {
    transition: all 0.3s ease-in-out;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-bottom: 0 !important;
}

.hidden-section.visible {
    max-height: 500px;
    opacity: 1;
    margin-bottom: 1.25rem !important;
}

.calc-value {
    font-weight: 600;
    color: #1d4ed8;
}

#toast {
    transition: opacity 0.5s, transform 0.5s;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
}

#toast.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #3b82f6;
    animation: spin 1s ease infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Style for the user type selector itself */
#userTypeSelector {
    margin-bottom: 1.5rem; /* This might be creating extra space - try reducing it */
}

#userTypeSelector label {
    display: block;
    margin-bottom: 0.5rem; /* mb-2 equivalent */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    color: #4b5563; /* text-gray-600 */
    /* Add this to remove any extra space: */
    margin: 0;
}

.user-type-grid {
    display: flex; /* Use flexbox */
    border-radius: 0.5rem; /* rounded-lg */
    border: 1px solid #d1d5db; /* border-gray-300 */
    overflow: hidden;
    /* Add this to remove any extra space: */
    margin: 0;
    padding: 0;
}

.user-type-grid input[type="radio"] {
    display: none; /* Hide the default radio button */
}

.user-type-grid label {
    flex: 1; /* Each label takes equal space */
    text-align: center;
    padding: 0.75rem 0.5rem; /* Increased padding for better spacing */
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex; /* Add flex to label */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    margin: 0; /* Remove all margins */
    border-right: 1px solid #d1d5db; /* border-gray-300 */
    /* Add this to prevent any extra space: */
    line-height: 1.2;
}

.user-type-grid label:last-child {
    border-right: none; /* No border on the last item */
}



/* Ensure the parent container is positioned relatively for the overlay */
#income-details-container { /* Assuming you add this ID to the main input div */
    position: relative;
}

/* Placeholder for future self-employed/mixed sections */
#selfEmployedSection, #mixedIncomeSection {
    display: none; /* Hidden by default, shown via JS if needed */
}

/* Custom period validation animations and styling */
@keyframes pulse-red {
    0%, 100% {
        border-color: #ef4444;
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    }
    50% {
        border-color: #dc2626;
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.2);
    }
}

@keyframes pulse-amber {
    0%, 100% {
        border-color: #f59e0b;
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
    }
    50% {
        border-color: #d97706;
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.2);
    }
}

.input-invalid {
    animation: pulse-red 2s ease-in-out infinite;
}

.input-warning {
    animation: pulse-amber 2s ease-in-out infinite;
}

.input-valid {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Enhanced message styling for better visibility */
.validation-message {
    position: relative;
    z-index: 10;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* --- Accordion styling for quarterly inputs --- */
/* Hide legacy Show/Hide buttons; header becomes the accordion trigger */
.quarter-toggle-btn,
.quarter-toggle-btn-mobile {
    display: none !important;
}

/* Add left chevron to quarter headers */
.quarter-header-toggle {
    position: relative;
    padding-left: 1.25rem; /* space for chevron */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.quarter-header-toggle::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid #4b5563; /* text-gray-600 */
    border-bottom: 2px solid #4b5563;
    transform: translateY(-50%) rotate(-45deg); /* collapsed: pointing right */
    transition: transform 0.2s ease;
}

.quarter-header-toggle.is-expanded::before {
    transform: translateY(-50%) rotate(45deg); /* expanded: pointing down */
}

/* Cookie Consent Banner Styles */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #222838; /* dark indigo */
  color: #ffffff; /* white text */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  padding: 15px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.35);
  z-index: 10000;
}

.cookie-consent-banner p {
  margin: 0;
  flex: 1 1 300px;
}

.cookie-consent-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: 15px;
}

.cookie-consent-button {
  background-color: #28a745; /* Accept: green */
  border: none;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
  user-select: none;
  flex: 0 0 auto;
}

.cookie-consent-button:hover,
.cookie-consent-button:focus {
  background-color: #218838; /* Accept hover: darker green */
  outline: none;
}

.cookie-consent-button.reject {
  background-color: #6c757d; /* Reject: grey */
}

.cookie-consent-button.reject:hover,
.cookie-consent-button.reject:focus {
  background-color: #5a6268; /* Reject hover: darker grey */
}

.cookie-consent-banner a {
  color: #fcd116; /* Metallic Yellow */
  text-decoration: underline;
}

@media (max-width: 768px) {
  .cookie-consent-banner {
    font-size: 12px;
    padding: 8px 12px;
    flex-direction: column;
    gap: 8px;
  }
  .cookie-consent-banner p {
    margin: 0;
    line-height: 1.3;
    flex: none;
  }
  .cookie-consent-buttons {
    justify-content: center;
    margin-left: 0;
    gap: 8px;
  }
  .cookie-consent-button {
    flex: 0 1 auto;
    padding: 6px 12px;
    font-size: 12px;
    text-align: center;
    min-width: 70px;
  }
}

@media (max-width: 480px) {
  .cookie-consent-banner {
    font-size: 11px;
    padding: 6px 8px;
    gap: 6px;
  }
  .cookie-consent-banner p {
    line-height: 1.2;
  }
  .cookie-consent-button {
    padding: 5px 10px;
    font-size: 11px;
    min-width: 60px;
  }
}