* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: auto;
    overflow: visible;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* --- Navigation --- */
.main-nav {
    margin: 15px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.main-nav a {
    text-decoration: none;
    color: #5f6368;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.main-nav a:hover {
    background-color: #f1f3f4;
}

.main-nav a.active {
    background-color: #667eea;
    color: white;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Two-Column Layout Styles */
.content-wrapper {
    display: flex;
    gap: 40px;
}

.main-content {
    flex: 3; /* Main content takes up 3/5 (60%) of the space */
    min-width: 0;
}

.sidebar {
    flex: 2; /* Sidebar takes up 2/5 (40%) of the space */
    min-width: 0;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.form-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1rem;
}

.input-group {
    position: relative;
}

.input-group input, #medical-dependants {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-group input:focus, #medical-dependants:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.currency-symbol {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    font-weight: 600;
}

.input-group input.with-symbol {
    padding-left: 35px;
}

.toggle-group {
    display: flex;
    background: #f1f3f4;
    border-radius: 10px;
    padding: 5px;
    gap: 5px;
}

.toggle-option {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #5f6368;
}

.toggle-option.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.age-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.age-option {
    flex: 1;
    min-width: 150px;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.age-option:hover {
    border-color: #667eea;
    background: white;
}

.age-option.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.age-option input[type="radio"] {
    display: none;
}

.age-option h4 {
    margin-bottom: 5px;
    font-size: 1rem;
}

.age-option p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* --- Advanced Section Styles --- */
.advanced-section {
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.advanced-title {
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #2c3e50;
}

.advanced-title .icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.advanced-content {
    padding: 20px;
    display: none;
    background: #fff;
}

.advanced-content label {
    font-weight: normal;
    font-size: 0.9rem;
    color: #5d6d7e;
    margin-bottom: 10px;
}

.advanced-section.active {
    border-color: #667eea;
}

.advanced-section.active .advanced-title .icon {
    transform: rotate(45deg);
}

.advanced-section.active .advanced-content {
    display: block;
}

/* New Medical Grid */
.medical-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.calculate-btn {
    width: 100%;
    padding: 18px;
    margin-top: 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.results {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
    display: none;
}

.results.show {
    display: block;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.results h3 {
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-align: center;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.result-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(5px);
}

.result-item h4 {
    margin-bottom: 10px;
    font-size: 1rem;
    opacity: 0.9;
}

.result-item .amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: #f39c12;
}

.breakdown {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.breakdown h4 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.breakdown-item:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.info-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.info-section h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.info-section h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 15px;
    margin-top: 25px;
}

.info-section p {
    color: #5d6d7e;
    margin-bottom: 15px;
    font-size: 1rem;
}

.info-section ul {
    color: #5d6d7e;
    margin-left: 20px;
    margin-bottom: 15px;
}

.info-section li {
    margin-bottom: 8px;
}

.tax-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tax-table th,
.tax-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.tax-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.tax-table tr:hover {
    background: #f8f9fa;
}

/* Promotion Section Styles */
.promo-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
    text-align: center;
    border: 2px dashed #667eea;
}

.promo-section h2 {
    color: #2c3e50;
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.promo-section p {
    color: #5d6d7e;
    font-size: 1rem;
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.promo-btn {
    display: inline-block;
    padding: 12px 25px;
    background: #f39c12;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.2);
}

.promo-btn:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.3);
}

/* FAQ section*/
.faq-section {
    margin-top: 30px;
}

.faq-header {
    text-align: center;
    padding-bottom: 20px;
}

.faq-item {
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
}

.faq-question {
    background: #667eea;
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question .icon {
    transition: transform 0.3s ease;
}

.faq-question.active .icon {
    transform: rotate(45deg);
}

/* FAQ answer - hidden by default but ready to animate */
.faq-answer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

/* When the parent .faq-item has the .open class, show answer */
.faq-item.open .faq-answer {
  max-height: 300px; /* or any value large enough for your content */
  opacity: 1;
}

/* Rotate the icon when open */
.faq-item.open .faq-question .icon {
  transform: rotate(45deg);
}

/* How It Works */
.how-it-works {
  padding: 10px 0;
  background-color: #f9fafb;
  text-align: center;
}

.how-it-works .container {
  max-width: 700px;
  margin: 0 auto;
}

.how-it-works h2 {
  font-size: 2em;
  margin-bottom: 0.5em;
}

.how-it-works p {
  font-size: 1em;
  margin-bottom: 1.5em;
  line-height: 1.6;
}

.how-it-works ol {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5em;
}

.how-it-works ol li {
  position: relative;
  padding-left: 3em;
  margin-bottom: 1.2em;
  text-align: left;
}

.how-it-works ol li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  font-size: 1.2em;
  font-weight: bold;
  width: 2em;
  height: 2em;
  line-height: 2em;
  text-align: center;
  background-color: #0073e6;
  color: #fff;
  border-radius: 50%;
}

.how-it-works .note {
  font-style: italic;
  color: #555;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .age-group {
        flex-direction: column;
    }

    .age-option {
        min-width: auto;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .medical-grid {
        grid-template-columns: 1fr;
    }
}

footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

footer a {
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

footer a:hover {
    color: #f39c12;
    border-bottom-color: #f39c12;
}