/* دستیار اظهارنامه — مکمل tariff-page.css */

.page-declaration .nav__cta.is-active {
  background: var(--navy) !important;
  color: var(--white) !important;
}

.decl-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem 1.25rem;
}
.decl-field--wide { grid-column: 1 / -1; }
.decl-field--checks { grid-column: 1 / -1; }

.decl-req { color: #c62828; }
.decl-field__hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.decl-rate-source {
  color: var(--teal-d);
  font-size: 0.72rem;
  margin-top: 0.15rem;
}
.decl-rate-source--stale {
  color: #b45309;
}

.decl-rate-panel {
  margin-top: 0.55rem;
}

.decl-rate-mode {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  gap: 0.15rem;
}

.decl-rate-mode__btn {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.decl-rate-mode__btn:hover {
  color: var(--navy);
}

.decl-rate-mode__btn.is-active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(0, 45, 45, 0.1);
}

.decl-rate-manual {
  margin-top: 0.55rem;
}

.decl-rate-manual__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.decl-rate-manual__input {
  max-width: 100%;
}

.decl-field--currency .decl-rate-source {
  margin-top: 0.35rem;
}

.decl-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--ink);
}
.decl-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(85, 201, 195, 0.15);
  background: var(--white);
}

.decl-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.4rem 0;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--ink);
}
.decl-insurance {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.decl-insurance legend { padding: 0 0.25rem; }
.decl-insurance__manual {
  margin-top: 0.5rem;
  max-width: 200px;
}

.decl-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.decl-calc-btn {
  min-width: 11rem;
  font-size: 1rem !important;
}

.decl-hs-preview {
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.85rem;
  background: rgba(85, 201, 195, 0.1);
  border-radius: var(--radius);
  border-right: 3px solid var(--teal);
  font-size: 0.85rem;
  color: var(--navy);
}

.decl-chips { margin-top: 1.25rem; }

.decl-results {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--line);
}
.decl-results__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.decl-results__title {
  margin: 0;
  font-size: 1.15rem;
  color: var(--navy);
  font-weight: 800;
}
.decl-results__badge {
  font-family: monospace;
  font-size: 0.85rem;
  padding: 0.25rem 0.65rem;
  background: var(--bg);
  border-radius: 6px;
  color: var(--navy);
  direction: ltr;
}
.decl-results__product {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.decl-breakdown {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.decl-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.decl-row:last-child { border-bottom: none; }
.decl-row--sub { padding-right: 1.75rem; font-size: 0.84rem; color: var(--muted); }
.decl-row--total {
  background: linear-gradient(135deg, var(--orange-l), #fff);
  font-weight: 700;
  color: var(--navy);
}
.decl-row span:last-child {
  font-weight: 700;
  color: var(--navy);
  direction: ltr;
  text-align: left;
  white-space: nowrap;
}

.decl-grand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
}
.decl-grand strong {
  font-size: 1.35rem;
  color: var(--teal);
  direction: ltr;
}

.decl-disclaimer {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.65;
}

.decl-results__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.page-declaration:has(#decl-results:not([hidden])) #decl-intro {
  padding: 1rem 1.25rem;
  margin-bottom: 0.85rem;
}
.page-declaration:has(#decl-results:not([hidden])) .tariff-intro__stats {
  display: none;
}

@media (max-width: 640px) {
  .decl-form__actions .tariff-search__btn { width: 100%; }
}
