/* ===== Страница «Подать заявку» ===== */

.app-page {
  padding: 2rem 0 4rem;
}

.app-hero {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.5rem;
}

.app-hero .page-title {
  margin-bottom: 0.75rem;
}

.app-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.app-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 520px;
  margin: 0 auto 2.5rem;
}

.app-progress__step {
  flex: 1;
  text-align: center;
  position: relative;
}

.app-progress__step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.app-progress__step.is-done:not(:last-child)::after {
  background: var(--accent);
}

.app-progress__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}

.app-progress__step.is-active .app-progress__num,
.app-progress__step.is-done .app-progress__num {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.app-progress__label {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.app-progress__step.is-active .app-progress__label {
  color: var(--text);
  font-weight: 600;
}

.app-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.app-card--brief {
  max-width: 860px;
}

.app-brief-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.25rem;
}

.app-brief-progress {
  flex: 0 0 220px;
  min-width: 180px;
}

.app-brief-progress__bar {
  height: 6px;
  background: var(--bg2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.app-brief-progress__bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #ff6b6b);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.app-brief-progress__text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.app-brief-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.app-brief-section-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.app-brief-section-tab:hover {
  border-color: rgba(230, 57, 70, 0.35);
}

.app-brief-section-tab.is-active {
  border-color: var(--accent);
  background: rgba(230, 57, 70, 0.12);
  color: var(--text);
  font-weight: 600;
}

.app-brief-section-tab.is-done:not(.is-active) {
  border-color: rgba(46, 204, 113, 0.35);
}

.app-brief-section-tab__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
}

.app-brief-section-tab.is-active .app-brief-section-tab__num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.app-brief-section-tab.is-done .app-brief-section-tab__num {
  background: rgba(46, 204, 113, 0.15);
  border-color: rgba(46, 204, 113, 0.4);
  color: #2ecc71;
}

.app-brief-section-tab__title {
  white-space: nowrap;
}

.app-brief-block__title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.app-label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.4rem;
}

.app-label-row .app-label {
  margin-bottom: 0;
}

.app-opt {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.app-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.85;
}

.app-field.is-invalid .app-input,
.app-field.is-invalid .app-textarea,
.app-field.is-invalid .app-select,
.app-field.is-invalid .app-options {
  border-color: rgba(230, 57, 70, 0.65);
  box-shadow: 0 0 0 1px rgba(230, 57, 70, 0.25);
}

.app-field--conditional {
  margin-left: 0.75rem;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(230, 57, 70, 0.35);
}

.app-field--conditional[hidden] {
  display: none !important;
}

.app-panel__title {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.app-panel__sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.app-service-block {
  margin-bottom: 1.5rem;
}

.app-service-block:last-child {
  margin-bottom: 0;
}

.app-service-block__title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

.app-service-block__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
}

.app-service-card {
  display: block;
  width: 100%;
  padding: 0.85rem 1rem;
  text-align: left;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.app-service-card:hover {
  border-color: rgba(230, 57, 70, 0.4);
}

.app-service-card.is-selected {
  border-color: var(--accent);
  background: rgba(230, 57, 70, 0.12);
  box-shadow: 0 0 0 1px var(--accent);
}

.app-field {
  margin-bottom: 1.15rem;
}

.app-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.app-req {
  color: var(--accent);
}

.app-input,
.app-textarea,
.app-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.app-input:focus,
.app-textarea:focus,
.app-select:focus {
  outline: none;
  border-color: rgba(230, 57, 70, 0.5);
}

.app-textarea {
  resize: vertical;
  min-height: 88px;
}

.app-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}

.app-options--radio,
.app-options--check {
  padding: 0.15rem 0;
}

.app-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.35;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.app-option:hover {
  border-color: rgba(230, 57, 70, 0.3);
}

.app-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(230, 57, 70, 0.1);
}

.app-option input {
  flex-shrink: 0;
  margin-top: 0.15rem;
  accent-color: var(--accent);
}

.app-option span {
  flex: 1;
}

.app-field--files {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.app-dropzone {
  padding: 1.75rem 1rem;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.app-dropzone:hover,
.app-dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(230, 57, 70, 0.05);
}

.app-dropzone__icon {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
}

.app-dropzone p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.app-dropzone small {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  opacity: 0.85;
}

.app-file-list {
  list-style: none;
  margin-top: 0.75rem;
}

.app-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  background: var(--bg2);
  border-radius: var(--radius);
  margin-bottom: 0.35rem;
}

.app-file-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.app-file-remove:hover {
  color: var(--accent);
  background: rgba(230, 57, 70, 0.1);
}

.app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.app-actions--sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-bottom: -0.5rem;
  padding-bottom: 1rem;
  background: linear-gradient(to top, var(--surface) 75%, transparent);
}

.app-actions .btn {
  min-width: 140px;
}

.app-actions .btn-primary {
  margin-left: auto;
}

.app-actions .btn[hidden] {
  display: none !important;
}

.app-actions--brief {
  padding-top: 0.75rem;
  margin-top: 1rem;
}

.app-actions-brief {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.app-actions-brief .btn-primary {
  margin-left: auto;
}

#app-brief-next,
#app-next-2 {
  margin-left: auto;
}

.app-error {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #ffb4b4;
  background: rgba(230, 57, 70, 0.12);
  border: 1px solid rgba(230, 57, 70, 0.35);
  border-radius: var(--radius);
}

.app-success {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  padding: 3rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.app-success__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(46, 204, 113, 0.15);
  border-radius: 50%;
  color: #2ecc71;
}

.app-success h2 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.app-success p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.app-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.app-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.app-consent input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

@media (max-width: 600px) {
  .app-card {
    padding: 1.35rem;
  }

  .app-card--brief {
    padding-bottom: 0.5rem;
  }

  .app-brief-head {
    flex-direction: column;
  }

  .app-brief-progress {
    flex: 1 1 100%;
  }

  .app-brief-section-tab__title {
    display: none;
  }

  .app-brief-section-tab.is-active .app-brief-section-tab__title {
    display: inline;
  }

  .app-options {
    grid-template-columns: 1fr;
  }

  .app-progress__label {
    font-size: 0.68rem;
  }

  .app-actions--brief {
    padding-top: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0;
    padding-bottom: 0.5rem;
  }

  .app-actions-brief {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  .app-actions-brief .btn {
    min-width: 0;
    width: 100%;
    padding: 0.55rem 0.65rem;
    font-size: 0.85rem;
  }

  .app-actions-brief .btn-primary {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .app-actions:not(.app-actions--brief) {
    flex-direction: column;
  }

  .app-actions:not(.app-actions--brief) .btn-primary {
    margin-left: 0;
    order: -1;
  }

  .app-service-block__grid {
    grid-template-columns: 1fr;
  }

  .app-field--conditional {
    margin-left: 0;
    padding-left: 0.65rem;
  }
}
