/* 모달 오버레이 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

/* 모달 컨테이너 */
.modal-container {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 모달 헤더 */
.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

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

/* Step 인디케이터 */
.step-indicator {
  display: inline-block;
  background: #5167f6;
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.step-title {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px 0;
  text-align: center;
}

.step-description {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 32px 0;
  text-align: center;
}

.step-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, #e5e7eb 20%, #e5e7eb 80%, transparent);
  margin: 0 0 32px 0;
}

/* 폼 그룹 */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: #5167f6;
  box-shadow: 0 0 0 3px rgba(81, 103, 246, 0.1);
}

.form-input::placeholder {
  color: #9ca3af;
}

.form-input.error {
  border-color: #ef4444;
}

.form-input.success {
  border-color: #10b981;
}

/* 입력 그룹 (버튼과 함께) */
.input-group {
  display: flex;
  gap: 8px;
}

.input-group .form-input {
  flex: 1;
}

.input-group-button {
  padding: 12px 20px;
  background: #5167f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.input-group-button:hover {
  background: #3d51d8;
}

.input-group-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* 도움말 텍스트 */
.form-help {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
}

.form-help.error {
  color: #ef4444;
}

.form-help.success {
  color: #10b981;
}

/* 버튼 */
.modal-button {
  width: 100%;
  padding: 14px;
  background: #5167f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.modal-button:hover {
  background: #3d51d8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(81, 103, 246, 0.3);
}

.modal-button:active {
  transform: translateY(0);
}

.modal-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

.modal-button.secondary {
  background: #f3f4f6;
  color: #374151;
}

.modal-button.secondary:hover {
  background: #e5e7eb;
}

/* 버튼 그룹 */
.button-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.button-group .modal-button {
  margin-top: 0;
}

/* 날짜 입력 */
input[type="date"].form-input {
  cursor: pointer;
}

/* 타이머 표시 */
.timer {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: #ef4444;
  font-weight: 600;
  pointer-events: none;
}

.input-with-timer {
  position: relative;
}

.input-with-timer .form-input {
  padding-right: 70px;
}

/* 반응형 */
@media (max-width: 640px) {
  .modal-container {
    width: 95%;
    max-height: 95vh;
  }

  .modal-body {
    padding: 20px;
  }

  .step-title {
    font-size: 20px;
  }

  .button-group {
    flex-direction: column;
  }
}

/* 로딩 스피너 */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 성공/에러 메시지 */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #3b82f6;
}

/* 구글 로그인 버튼 */
.google-login-button {
  width: 100%;
  padding: 14px 20px;
  background: white;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.google-login-button:hover {
  background: #f8f9fa;
  border-color: #c6c6c6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.google-login-button:active {
  background: #f1f3f4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.google-login-button:disabled {
  background: #f8f9fa;
  color: #9aa0a6;
  cursor: not-allowed;
  opacity: 0.6;
}

.google-logo {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* 모달 센터 정렬 */
.modal-center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 0;
}

.modal-center-content h3 {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px 0;
}

.modal-center-content p {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 32px 0;
  line-height: 1.6;
}

/* ========== 이메일 인증 폼 스타일 ========== */

/* 인증 폼 */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
  width: 100%;
}

/* 폼 필드 */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-field label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.form-field input {
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-field input:focus {
  outline: none;
  border-color: #5167f6;
  box-shadow: 0 0 0 3px rgba(81, 103, 246, 0.1);
}

.form-field input::placeholder {
  color: #9ca3af;
}

/* 필드 힌트 */
.field-hint {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

/* 인증 제출 버튼 */
.auth-submit-btn {
  padding: 14px;
  background: #5167f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.auth-submit-btn:hover {
  background: #3d51d8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(81, 103, 246, 0.3);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* 인증 링크 */
.auth-links {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  margin: 16px 0;
}

.auth-links a {
  color: #5167f6;
  text-decoration: none;
  font-weight: 600;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-link-divider {
  margin: 0 12px;
  color: #d1d5db;
}

/* 구분선 */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  width: 100%;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e5e7eb;
}

.auth-divider span {
  padding: 0 16px;
  color: #9ca3af;
  font-size: 14px;
  white-space: nowrap;
}

/* 비밀번호 재설정 설명 */
.reset-description {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 20px;
  text-align: center;
  line-height: 1.6;
}
