/**
 * components.css
 * 공통 UI 컴포넌트 스타일
 */

/* ==========================================
   토스트 알림
   ========================================== */
.toast-message {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #1a376f;
  color: #ffffff;
  padding: 16px 28px;
  border-radius: 12px;
  font-family: "Pretendard", sans-serif;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(26, 55, 111, 0.3);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-message.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-message .toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #10b981;
  color: #ffffff;
  border-radius: 50%;
  font-size: 12px;
  margin-right: 10px;
}

/* ==========================================
   레이어 팝업
   ========================================== */
.layer-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
}

.layer-popup-overlay.active {
  display: flex;
}

.layer-popup {
  background: #ffffff;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.layer-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.layer-popup-title {
  font-family: "Pretendard", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1a1f29;
  margin: 0;
}

.layer-popup-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.layer-popup-close:hover {
  background: #e5e7eb;
}

.layer-popup-close svg {
  width: 20px;
  height: 20px;
  color: #6b7280;
}

.layer-popup-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.layer-popup-section {
  margin-bottom: 20px;
}

.layer-popup-section:last-child {
  margin-bottom: 0;
}

.layer-popup-section-title {
  font-family: "Pretendard", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #1a1f29;
  margin: 0 0 8px 0;
}

.layer-popup-section-content {
  font-family: "Pretendard", sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
}

.layer-popup-section-content p {
  margin: 0 0 8px 0;
}

.layer-popup-section-content p:last-child {
  margin-bottom: 0;
}

.layer-popup-subsection {
  margin-bottom: 12px;
  padding-left: 16px;
}

.layer-popup-subsection:last-child {
  margin-bottom: 0;
}

.layer-popup-subsection-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 4px 0;
}

.layer-popup-subsection-content {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* ==========================================
   인라인 폼 에러
   ========================================== */
.form-error {
  display: none;
  position: absolute;
  right: 0;
  bottom: -18px;
  font-family: "Pretendard", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #dc2626;
}

.form-error.show {
  display: block;
}

.form-error::before {
  content: "※ ";
}

@media (max-width: 560px) {
  .form-error {
    padding-left: 0;
  }
}

/* 에러 상태의 입력 필드 */
.has-error {
  border-color: #dc2626 !important;
  background-color: #fef2f2 !important;
}

.has-error:focus {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}
