/* ============================================================
   CHEONGRIN — EmailJS 설정 모달 & 관련 UI 스타일
============================================================ */

/* ── 설정 행 (폼 상단) ── */
.ejs-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  flex-wrap: wrap;
}

/* 상태 배지 */
.ejs-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .8125rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 100px;
  letter-spacing: .02em;
  transition: all .25s ease;
}

.ejs-badge--unconfigured {
  background: #fef2f2;
  color: #b91c1c;
  border: 1.5px solid #fecaca;
}

.ejs-badge--configured {
  background: #f0fdf4;
  color: #166534;
  border: 1.5px solid #bbf7d0;
}

/* 설정 열기 버튼 */
.ejs-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: .8125rem;
  font-weight: 700;
  color: #2563eb;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  cursor: pointer;
  transition: all .22s ease;
  white-space: nowrap;
}

.ejs-open-btn:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,99,235,.3);
}

/* ── 모달 ── */
.ejs-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ejs-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: ejsFadeIn .2s ease;
}

.ejs-modal-box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 60px rgba(0,0,0,.25), 0 0 0 1px rgba(0,0,0,.05);
  overflow: hidden;
  animation: ejsSlideUp .3s cubic-bezier(.34,1.56,.64,1);
}

/* 모달 헤더 */
.ejs-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 18px;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.ejs-modal-header h2 {
  font-size: 1.125rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -.01em;
}

.ejs-modal-header h2 i {
  color: #38bdf8;
  font-size: 1.1rem;
}

.ejs-modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: all .2s ease;
}
.ejs-modal-close:hover {
  background: rgba(255,255,255,.2);
  color: #fff;
  transform: rotate(90deg);
}

/* 모달 바디 */
.ejs-modal-body {
  padding: 28px;
}

.ejs-desc {
  font-size: .9rem;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 3px solid #2563eb;
}

.ejs-desc a {
  color: #2563eb;
  font-weight: 700;
  text-decoration: underline;
}

/* 단계 목록 */
.ejs-steps {
  list-style: decimal;
  padding-left: 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ejs-steps li {
  font-size: .875rem;
  color: #334155;
  padding: 6px 0;
  border-bottom: 1px dashed #e2e8f0;
  line-height: 1.5;
}

.ejs-steps li:last-child { border-bottom: none; }

.ejs-steps a {
  color: #2563eb;
  font-weight: 700;
  text-decoration: none;
}
.ejs-steps a:hover { text-decoration: underline; }

/* 입력 필드 */
.ejs-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}

.ejs-field label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ejs-field label span { color: #ef4444; }

.ejs-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .9375rem;
  color: #1e293b;
  font-family: 'Inter', monospace;
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.ejs-field input::placeholder { color: #94a3b8; font-size: .875rem; }

.ejs-field input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* 버튼 영역 */
.ejs-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.ejs-actions .btn { flex: 1; justify-content: center; }

.ejs-btn-cancel {
  flex: 1;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: .9375rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: all .2s ease;
}
.ejs-btn-cancel:hover {
  background: #e2e8f0;
  color: #334155;
}

/* 안내 */
.ejs-note {
  font-size: .775rem;
  color: #94a3b8;
  text-align: center;
  letter-spacing: .01em;
}

/* ── 토스트 알림 ── */
#ejs-toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #fff;
  padding: 13px 24px;
  border-radius: 100px;
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  z-index: 9999;
  max-width: calc(100vw - 40px);
  text-align: center;
}

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

#ejs-toast.ejs-toast--success { background: #166534; }
#ejs-toast.ejs-toast--error   { background: #991b1b; }

/* ── 키프레임 ── */
@keyframes ejsFadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes ejsSlideUp  {
  from { opacity: 0; transform: scale(.92) translateY(24px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* ── 반응형 ── */
@media (max-width: 540px) {
  .ejs-modal-body   { padding: 20px; }
  .ejs-actions      { flex-direction: column; }
  .ejs-config-row   { flex-direction: column; align-items: flex-start; }
  .ejs-open-btn     { width: 100%; justify-content: center; }
}
