/* ==========================================================
   SHAREMARKETGYAN
   FINANCIAL CALCULATORS
   calculator.css
========================================================== */


/* ==========================================================
   CALCULATOR PAGE
========================================================== */

.calculator-page {
  padding: 80px 0 90px;
  background: #f8fafc;
  min-height: 65vh;
}


/* ==========================================================
   CALCULATOR CONTAINER
========================================================== */

.calculator-shell {
  max-width: 900px;
  margin: 42px auto 0;
  padding: 38px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  box-shadow: var(--shadow);
}


/* ==========================================================
   FORM
========================================================== */

.calculator-form {
  display: grid;
  gap: 28px;
}


/* ==========================================================
   FIELD GRID
========================================================== */

.calc-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}


/* ==========================================================
   FIELD
========================================================== */

.calc-field {
  display: grid;
  gap: 8px;
}

.calc-field label {
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}


/* ==========================================================
   NUMBER INPUT WITH UNIT
========================================================== */

.calc-input-wrap {
  display: flex;
  width: 100%;
  align-items: stretch;
}

.calc-input-wrap input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 14px 16px;

  border: 1px solid #cbd5e1;
  border-right: 0;
  border-radius: 12px 0 0 12px;

  background: #ffffff;
  color: #0f172a;

  font: inherit;
  font-size: 15px;

  outline: none;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.calc-input-wrap input:hover {
  border-color: #94a3b8;
}

.calc-input-wrap input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}


/* ==========================================================
   INPUT UNIT
========================================================== */

.calc-input-wrap span {
  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 65px;
  padding: 0 12px;

  border: 1px solid #cbd5e1;
  border-radius: 0 12px 12px 0;

  background: #f8fafc;
  color: #475569;

  font-size: 14px;
  font-weight: 700;
}


/* ==========================================================
   SELECT
========================================================== */

.calc-field select {
  width: 100%;
  padding: 14px 16px;

  border: 1px solid #cbd5e1;
  border-radius: 12px;

  background: #ffffff;
  color: #0f172a;

  font: inherit;
  font-size: 15px;

  outline: none;
  cursor: pointer;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.calc-field select:hover {
  border-color: #94a3b8;
}

.calc-field select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}


/* ==========================================================
   CALCULATOR ACTIONS
========================================================== */

.calculator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;

  padding-top: 4px;
}

.calculator-actions .btn {
  border: 0;
  cursor: pointer;
}


/* ==========================================================
   SECONDARY BUTTON
========================================================== */

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 12px 22px;

  border: 1px solid #cbd5e1 !important;
  border-radius: 10px;

  background: #e2e8f0;
  color: #0f172a;

  font-weight: 700;
  text-decoration: none;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.btn-secondary:hover {
  background: #cbd5e1;
  border-color: #94a3b8 !important;
  transform: translateY(-1px);
}


/* ==========================================================
   RESULT BOX
========================================================== */

.calculator-result {
  margin-top: 28px;
  padding: 26px;

  min-height: 90px;

  border: 1px solid #dbeafe;
  border-radius: 18px;

  background: #eff6ff;

  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}


/* ==========================================================
   EMPTY RESULT
========================================================== */

.result-empty {
  display: flex;
  align-items: center;
  gap: 12px;

  color: #64748b;
}

.result-empty i {
  font-size: 22px;
}

.result-empty p {
  margin: 0;
  line-height: 1.6;
}


/* ==========================================================
   RESULT HEADER
========================================================== */

.result-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;
  flex: 0 0 44px;

  border-radius: 50%;

  background: #dbeafe;
  color: #2563eb;

  font-size: 18px;
}

.result-label {
  display: block;

  margin-bottom: 3px;

  color: #64748b;

  font-size: 12px;
  font-weight: 800;

  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-header strong {
  display: block;

  color: #0f172a;

  font-size: 20px;
  line-height: 1.3;
}


/* ==========================================================
   PRIMARY RESULT
========================================================== */

.result-primary {
  margin: 24px 0;

  color: #0f172a;

  font-size: clamp(30px, 5vw, 42px);
  font-weight: 800;
  line-height: 1.1;

  word-break: break-word;
}


/* ==========================================================
   RESULT GRID
========================================================== */

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 12px;
}


/* ==========================================================
   RESULT ITEM
========================================================== */

.result-item {
  padding: 15px 16px;

  border: 1px solid #dbeafe;
  border-radius: 12px;

  background: #ffffff;
}

.result-item span {
  display: block;

  margin-bottom: 5px;

  color: #64748b;

  font-size: 13px;
  line-height: 1.4;
}

.result-item strong {
  display: block;

  color: #0f172a;

  font-size: 16px;
  line-height: 1.4;
}


/* ==========================================================
   RESULT NOTE
========================================================== */

.result-note {
  margin: 18px 0 0;

  color: #475569;

  font-size: 13px;
  line-height: 1.7;
}


/* ==========================================================
   SUCCESS RESULT
========================================================== */

.calculator-result-success {
  border-color: #bfdbfe;
  background: #eff6ff;
}


/* ==========================================================
   ERROR RESULT
========================================================== */

.calculator-result-error {
  display: flex;
  align-items: flex-start;
  gap: 14px;

  border-color: #fecaca;
  background: #fef2f2;
}

.calculator-result-error .result-icon {
  flex: 0 0 44px;

  background: #fee2e2;
  color: #dc2626;
}

.calculator-result-error strong {
  color: #991b1b;
  font-size: 18px;
}

.calculator-result-error p {
  margin: 6px 0 0;

  color: #7f1d1d;

  font-size: 14px;
  line-height: 1.6;
}


/* ==========================================================
   CALCULATOR DISCLAIMER
========================================================== */

.calculator-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;

  max-width: 900px;

  margin: 18px auto 0;

  color: #64748b;

  font-size: 13px;
  line-height: 1.7;
}

.calculator-note i {
  margin-top: 3px;
  color: #64748b;
}

.calculator-note p {
  margin: 0;
}


/* ==========================================================
   NUMBER INPUT CLEANUP
========================================================== */

.calc-input-wrap input::-webkit-outer-spin-button,
.calc-input-wrap input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.calc-input-wrap input[type="number"] {
  -moz-appearance: textfield;
}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 900px) {

  .calculator-shell {
    max-width: 100%;
  }

}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 768px) {

  .calculator-page {
    padding: 55px 0 65px;
  }

  .calculator-shell {
    margin-top: 28px;
    padding: 24px 18px;

    border-radius: 18px;
  }

  .calc-fields-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

  .calculator-actions {
    flex-direction: column;
  }

  .calculator-actions .btn,
  .calculator-actions .btn-secondary {
    width: 100%;
  }

  .result-primary {
    font-size: 30px;
  }

  .calculator-note {
    font-size: 12px;
  }

}


/* ==========================================================
   SMALL MOBILE
========================================================== */

@media (max-width: 480px) {

  .calculator-shell {
    padding: 20px 14px;
  }

  .calculator-result {
    padding: 20px 16px;
  }

  .result-header {
    align-items: flex-start;
  }

  .result-primary {
    font-size: 28px;
  }

  .result-item {
    padding: 13px 14px;
  }

}