/* Calculators & Generators Styling - SmartPaisa.in */

.calculator-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: start;
}

/* Form Styling */
.form-group {
  margin-bottom: 24px;
}

.label-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.form-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-body);
}

.input-suffix {
  position: absolute;
  right: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, background-color var(--transition-speed);
}

.form-input-has-prefix {
  padding-left: 36px;
}

.form-input-has-suffix {
  padding-right: 48px;
}

.form-input:focus {
  border-color: var(--primary);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236B7280'%3E%3Cpath fill-rule='evenodd' d='d5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
  transition: border-color 0.2s, background-color var(--transition-speed);
}

.form-select:focus {
  border-color: var(--primary);
}

/* Range Slider Styling */
.range-slider {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  outline: none;
  margin-top: 10px;
  cursor: pointer;
  appearance: none;
  transition: background-color var(--transition-speed);
}

.range-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.1s;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.1s;
}

.range-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.smart-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Inline Errors */
.error-msg {
  color: var(--red);
  font-size: 0.8rem;
  margin-top: 4px;
  display: none;
}

/* Toggles & Switch buttons */
.toggle-group {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.toggle-btn {
  background: none;
  border: none;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.toggle-btn.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Results Section styling */
.results-card {
  border-left: 4px solid var(--primary);
  position: sticky;
  top: 92px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.result-row:last-of-type {
  border-bottom: none;
}

.result-label {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.result-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--text-primary);
}

.result-value-large {
  font-size: 1.8rem;
}

/* Dynamic chart placeholder */
.chart-container {
  position: relative;
  margin: 24px auto 0;
  height: 240px;
  width: 100%;
}

/* Button toolbar */
.action-toolbar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
}

/* Quiz UI ("Which tax regime is better", "Financial Health Score") */
.quiz-container {
  max-width: 640px;
  margin: 0 auto;
}

.quiz-progress {
  width: 100%;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
}

.quiz-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-pill);
  width: 0%;
  transition: width 0.3s ease;
}

.quiz-step {
  display: none;
}

.quiz-step.active {
  display: block;
}

.quiz-question {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.quiz-option {
  display: flex;
  align-items: center;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  background: var(--white);
}

.quiz-option:hover {
  border-color: var(--primary-light);
  background: var(--bg-subtle);
}

.quiz-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.quiz-option input[type="radio"] {
  margin-right: 12px;
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.quiz-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

/* Financial Health Badge */
.health-score-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  margin: 0 auto 20px;
  border: 8px solid var(--bg-subtle);
  font-family: var(--font-mono);
}

.health-poor { color: var(--red); border-color: var(--red-light); }
.health-average { color: var(--gold); border-color: var(--gold-light); }
.health-good { color: var(--primary); border-color: var(--primary-light); }
.health-excellent { color: var(--green); border-color: var(--green-light); }

/* Compare Grid */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0;
}

.comparison-column {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s;
}

.comparison-column.highlight {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.comparison-header {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

/* Salary slip / Rent receipt document templates */
.doc-output-container {
  background: #fff;
  color: #000;
  padding: 40px;
  border: 1px solid #ccc;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  margin-top: 24px;
  font-family: 'Inter', Arial, sans-serif;
}

.doc-header {
  text-align: center;
  border-bottom: 2px solid #000;
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.doc-company-name {
  font-size: 1.6rem;
  font-weight: 700;
  text-transform: uppercase;
}

.doc-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 8px;
  text-transform: uppercase;
}

.doc-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.doc-table th, .doc-table td {
  border: 1px solid #000;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.doc-table th {
  background-color: #f2f2f2;
  text-align: left;
}

.doc-table-total {
  font-weight: 700;
  background-color: #e6e6e6;
}

.doc-footer {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.doc-signature-line {
  border-top: 1px solid #000;
  width: 200px;
  margin-top: 40px;
  text-align: center;
  padding-top: 4px;
}

/* Print Overrides for Document tools */
@media print {
  .doc-output-container {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 0 !important;
  }
}

/* Quiz Widgets */
.quiz-container {
  max-width: 600px;
  margin: 0 auto;
}
.quiz-progress {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  overflow: hidden;
}
.quiz-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.3s ease;
}
.quiz-step {
  display: none;
}
.quiz-step.active {
  display: block;
  animation: fadeIn 0.4s ease;
}
.quiz-question {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.quiz-option {
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}
.quiz-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.quiz-buttons {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
}

/* Financial Health Score Ring */
.health-score-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 8px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  margin: 20px auto;
  font-family: var(--font-heading);
  transition: border-color 0.3s;
}
.health-poor {
  border-color: var(--red) !important;
  color: var(--red) !important;
}
.health-average {
  border-color: var(--gold) !important;
  color: var(--gold) !important;
}
.health-good {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}
.health-excellent {
  border-color: var(--green) !important;
  color: var(--green) !important;
}

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