/* =========================================
   뉴로메트릭 멤버 앱 - 공통 CSS
   메인 색상: 밝은 파랑 (#2196F3 계열)
   텍스트: 진한 네이비 (#1A2744 계열)
   ========================================= */

:root {
  --primary: #2196F3;
  --primary-dark: #1565C0;
  --primary-light: #E3F2FD;
  --primary-mid: #90CAF9;
  --accent: #1976D2;
  --navy: #1A2744;
  --navy-mid: #2C3E6B;
  --text-primary: #1A2744;
  --text-secondary: #4A5877;
  --text-muted: #8B95AA;
  --white: #FFFFFF;
  --bg: #F4F7FC;
  --bg-card: #FFFFFF;
  --border: #DDE4F0;
  --border-light: #EEF2FA;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --shadow-sm: 0 1px 3px rgba(26,39,68,0.08);
  --shadow-md: 0 4px 12px rgba(26,39,68,0.10);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: var(--font);
}

input, textarea, select {
  font-family: var(--font);
  outline: none;
}

/* ===== 공통 버튼 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover { background: var(--accent); }

.btn-primary-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-primary-outline:hover { background: var(--primary-light); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover { opacity: 0.9; }

.btn-secondary {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--border-light); }

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.btn-full {
  width: 100%;
}

/* ===== 공통 폼 ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text-primary);
  background: var(--white);
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: var(--primary);
}

.form-input::placeholder {
  color: var(--text-muted);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

/* ===== 비밀번호 보기 토글 ===== */
.pw-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-input-wrap .form-input {
  padding-right: 46px;
}

.pw-toggle-btn {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 44px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: color 0.15s, background 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.pw-toggle-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238B95AA' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ===== 공통 배지 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-blue { background: var(--primary-light); color: var(--primary-dark); }
.badge-green { background: #DCFCE7; color: #166534; }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-red { background: #FEE2E2; color: #991B1B; }
.badge-gray { background: #F1F5F9; color: #64748B; }

/* ===== 공통 카드 ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.card-body {
  padding: 16px;
}

/* ===== 공통 알림 ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 12px;
}

.alert-info { background: var(--primary-light); color: var(--primary-dark); border-left: 3px solid var(--primary); }
.alert-success { background: #DCFCE7; color: #166534; border-left: 3px solid var(--success); }
.alert-warning { background: #FEF3C7; color: #92400E; border-left: 3px solid var(--warning); }
.alert-error { background: #FEE2E2; color: #991B1B; border-left: 3px solid var(--danger); }

/* ===== 로딩 스피너 ===== */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ===== 모달 ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-body {
  padding: 16px 20px 20px;
}

/* ===== 빈 상태 ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 15px;
  font-weight: 500;
}

/* ===== 토스트 알림 ===== */
#toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  background: var(--navy);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  animation: toastIn 0.2s ease;
}

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

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== hidden 유틸 ===== */
.hidden { display: none !important; }
