/* =============================================
   Step 1 - 병원 선택 (최대 3개) 화면
   2팀(프론트엔드) 영역
   ============================================= */

/* === Header === */
.s1-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-lg);
}

.s1-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--color-primary);
}

.s1-limit {
  font-size: 12px;
  color: #fff;
  background: linear-gradient(135deg, #c9a96e, #b8860b);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* === Selected Tags === */
.s1-selected {
  background: #f0f7ff;
  border: 1px solid #d0e3f5;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: var(--space-lg);
}

.s1-sel-label {
  font-size: 13px;
  font-weight: 600;
  color: #1565c0;
  margin-bottom: 10px;
}

.s1-sel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.s1-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #b3d4fc;
  color: #1565c0;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.s1-tag-x {
  background: none;
  border: none;
  color: #90a4ae;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.2s;
}

.s1-tag-x:hover {
  color: #e53935;
}

/* === Count === */
.s1-count {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

/* === Hospital Grid — 데스크탑 3열, 태블릿 2열, 모바일 1열 === */
.s1-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: var(--space-xl);
}

/* === Hospital Card (세로형) === */
.s1-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 24px 16px 18px;
  background: #fff;
  transition: all 0.2s ease;
}

.s1-card:hover {
  border-color: #c9a96e;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  transform: translateY(-2px);
}

.s1-card.s1-active {
  border-color: #c9a96e;
  background: linear-gradient(135deg, #fffdf5, #faf6eb);
  box-shadow: 0 4px 16px rgba(201,169,110,0.18);
}

.s1-card.s1-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.s1-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 14px;
}

.s1-icon {
  font-size: 30px;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f7;
  border-radius: 14px;
}

.s1-active .s1-icon {
  background: rgba(201,169,110,0.15);
}

.s1-info {
  width: 100%;
}

.s1-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 2px;
}

.s1-name-en {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.s1-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.s1-dot {
  color: #ccc;
}

/* === Select Button === */
.s1-btn {
  width: 100%;
  padding: 10px 0;
  border: 2px solid #c9a96e;
  border-radius: 10px;
  background: #fff;
  color: #c9a96e;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.s1-btn:hover {
  background: linear-gradient(135deg, #c9a96e, #b8860b);
  color: #fff;
  box-shadow: 0 4px 12px rgba(201,169,110,0.3);
}

.s1-btn.s1-btn-active {
  background: linear-gradient(135deg, #c9a96e, #b8860b);
  color: #fff;
  border-color: #b8860b;
}

.s1-btn.s1-btn-active:hover {
  background: #e53935;
  border-color: #e53935;
  box-shadow: 0 4px 12px rgba(229,57,53,0.3);
}

.s1-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* === Search === */
.srch {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  margin-bottom: var(--space-md);
  box-sizing: border-box;
  transition: var(--transition-fast);
}

.srch:focus {
  outline: none;
  border-color: #c9a96e;
  box-shadow: 0 0 0 3px rgba(201,169,110,0.15);
}

/* === Loading / Empty === */
.loading-msg {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--color-text-muted);
  font-size: var(--font-size-md);
}

.empty-msg {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--color-text-muted);
  font-size: var(--font-size-md);
}

/* === Responsive === */
@media (max-width: 960px) {
  .s1-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .s1-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .s1-card {
    padding: 12px 8px 10px;
    border-radius: 12px;
    border-width: 1.5px;
  }

  .s1-card-body {
    gap: 6px;
    margin-bottom: 8px;
  }

  .s1-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .s1-name {
    font-size: 12px;
    line-height: 1.3;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .s1-name-en {
    font-size: 10px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .s1-meta {
    font-size: 10px;
    gap: 2px;
  }

  .s1-btn {
    padding: 7px 0;
    font-size: 12px;
    border-radius: 8px;
    border-width: 1.5px;
  }

  .s1-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .s1-header h3 {
    font-size: 16px;
  }

  .s1-selected {
    padding: 10px 12px;
    margin-bottom: 12px;
  }

  .s1-sel-label {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .s1-tag {
    font-size: 11px;
    padding: 4px 8px;
    gap: 4px;
  }

  .s1-sel-tags {
    gap: 6px;
  }
}
