/* ============================================================
   «Рядом» — Screening Page Styles
   Depends on main.css for variables and base styles
   ============================================================ */

@layer components {

  /* ---- Page layout ---- */
  .screening-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .screening-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-block: 40px 64px;
  }

  @media (min-width: 768px) {
    .screening-main {
      padding-block: 56px 80px;
    }
  }

  .screening-container {
    width: 100%;
    max-width: 640px;
    padding-inline: 20px;
    margin-inline: auto;
  }

  /* ---- Screen switching ---- */
  .screen {
    display: none;
  }

  .screen.active {
    display: block;
  }

  /* ---- Intro screen ---- */
  .intro-label {
    display: block;
    margin-bottom: 16px;
  }

  .intro-heading {
    margin-bottom: 20px;
  }

  .intro-description {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.7;
  }

  .intro-actions {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .intro-cta {
    justify-content: center;
  }

  .intro-privacy {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
  }

  .intro-privacy i {
    color: var(--accent-sage);
    font-size: 14px;
    flex-shrink: 0;
  }

  /* ---- Wizard screen ---- */
  .progress-track {
    width: 100%;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 24px;
  }

  .progress-bar {
    height: 100%;
    background: var(--accent-sage);
    border-radius: 2px;
    transition: width 0.3s ease-out;
    will-change: width;
  }

  @media (prefers-reduced-motion: reduce) {
    .progress-bar {
      transition: none;
    }
  }

  .question-counter {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 20px;
    display: block;
  }

  .question-text {
    font-size: 1.1875rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 12px;
  }

  @media (min-width: 480px) {
    .question-text {
      font-size: 1.25rem;
    }
  }

  .question-example {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 28px;
    padding: 10px 14px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--border);
  }

  .question-example:empty {
    display: none;
  }

  .answer-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
  }

  .btn-answer {
    min-height: 56px;
    width: 100%;
    justify-content: center;
    font-size: 1.0625rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition:
      background var(--transition),
      transform var(--transition),
      box-shadow var(--transition),
      opacity var(--transition);
    position: relative;
  }

  .btn-answer-yes {
    background: var(--accent-sage);
    color: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(94, 158, 126, 0.25);
  }

  .btn-answer-yes:hover {
    background: var(--accent-sage-dark);
    box-shadow: 0 4px 16px rgba(94, 158, 126, 0.35);
    transform: translateY(-1px);
  }

  .btn-answer-no {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
  }

  .btn-answer-no:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
    background: var(--bg-surface);
    transform: translateY(-1px);
  }

  .btn-answer.selected {
    opacity: 0.7;
    transform: scale(0.98);
    pointer-events: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .btn-answer.selected {
      opacity: 0.7;
      transform: none;
    }
  }

  .wizard-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9375rem;
    cursor: pointer;
    padding: 8px 0;
    transition: color var(--transition);
    text-decoration: none;
    font-weight: 500;
    min-height: 44px;
  }

  .btn-back:hover {
    color: var(--text-secondary);
  }

  .btn-back.hidden {
    visibility: hidden;
    pointer-events: none;
  }

  /* ---- Result screen ---- */
  .result-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 36px;
  }

  .result-icon-wrap.low {
    background: var(--accent-sage-light);
    color: var(--accent-sage);
  }

  .result-icon-wrap.medium {
    background: var(--accent-amber-light);
    color: var(--accent-amber);
  }

  .result-icon-wrap.high {
    background: #FDEAEA;
    color: #C0392B;
  }

  .result-heading {
    font-size: clamp(1.375rem, 3vw, 1.75rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: 16px;
  }

  .result-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
  }

  .result-score {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 24px;
  }

  .result-score strong {
    color: var(--text-primary);
    font-weight: 700;
  }

  .result-steps {
    margin-bottom: 28px;
  }

  .result-steps-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
  }

  .result-steps ol {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    counter-reset: steps;
  }

  .result-steps ol li {
    counter-increment: steps;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
  }

  .result-steps ol li::before {
    content: counter(steps);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
  }

  .hotline-block {
    background: #FDEAEA;
    border: 1px solid rgba(192, 57, 43, 0.2);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .hotline-block i {
    font-size: 22px;
    color: #C0392B;
    flex-shrink: 0;
  }

  .hotline-block-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .hotline-label {
    font-size: 0.8125rem;
    color: #C0392B;
    font-weight: 600;
  }

  .hotline-number {
    font-size: 1.125rem;
    font-weight: 700;
    color: #C0392B;
    text-decoration: none;
    letter-spacing: 0.02em;
  }

  .hotline-number:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .result-cta {
    justify-content: center;
  }

  .btn-restart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9375rem;
    cursor: pointer;
    padding: 10px 0;
    transition: color var(--transition);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    width: 100%;
    min-height: 44px;
    font-family: var(--font-sans);
  }

  .btn-restart:hover {
    color: var(--text-secondary);
  }

  .result-disclaimer {
    margin-top: 20px;
  }

  /* ---- Separator ---- */
  .result-sep {
    border: none;
    border-top: 1px solid var(--border);
    margin-block: 24px;
  }

}
