:root {
  --primary: #0066FF;
  --primary-hover: #0052CC;
  --primary-light: #EBF3FF;
  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --text-main: #191F28;
  --text-sub: #4E5968;
  --text-muted: #8B95A1;
  --bg-page: #F8F9FA;
  --bg-card: #FFFFFF;
  --border: #E5E8EB;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  line-height: 1.5;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.container {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* 상단 배너 */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.brand-logo {
  font-size: 19px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.5px;
}
.brand-logo-img {
  height: 32px;
  max-width: 175px;
  width: auto;
  object-fit: contain;
  display: block;
}
.badge-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
}
.badge-status.installed {
  background: var(--success-light);
  color: var(--success);
}

/* 메인 뷰 섹션들 */
.view-section {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}
.view-section.active {
  display: flex;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 아이콘 스타일 */
.hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 32px;
}
.hero-icon.success {
  background: var(--success-light);
  color: var(--success);
}
.hero-icon.warning {
  background: var(--warning-light);
  color: var(--warning);
}

h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  color: var(--text-main);
}
p.desc {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* 인포 박스 */
.info-card {
  background: #F2F4F6;
  border-radius: var(--radius-md);
  padding: 16px;
  width: 100%;
  text-align: left;
  margin-bottom: 24px;
}
.info-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}
.info-item:last-child {
  margin-bottom: 0;
}
.info-item .label {
  color: var(--text-muted);
}
.info-item .val {
  font-weight: 600;
  color: var(--text-main);
}

/* 주의사항 체크 */
.checklist {
  background: #FAFAFB;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  width: 100%;
  text-align: left;
  margin-bottom: 24px;
}
.checklist-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.check-item {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}
.check-item:last-child {
  margin-bottom: 0;
}

/* 액션 버튼들 */
.btn {
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.25);
}
.btn-primary:active {
  background: var(--primary-hover);
  transform: scale(0.98);
}
.btn-primary:disabled,
.btn-primary[disabled],
.btn-primary.disabled {
  background: #D1D5DB;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}
.btn-secondary {
  background: #F2F4F6;
  color: var(--text-main);
  margin-top: 10px;
}
.btn-secondary:active {
  background: #E5E8EB;
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-sub);
  margin-top: 10px;
}

/* 인앱 브라우저 경고 알림 바 */
.inapp-banner {
  display: none;
  background: #FFF9E6;
  border: 1px solid #FFE58F;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
  text-align: left;
}
.inapp-banner.active {
  display: block;
}
.inapp-header {
  font-size: 13px;
  font-weight: 700;
  color: #D46B08;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.inapp-desc {
  font-size: 12px;
  color: #873800;
  line-height: 1.4;
}
.inapp-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  background: #D46B08;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

/* 로딩 애니메이션 및 프로그레스 */
.pulse-radar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(0, 102, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  position: relative;
}
.pulse-radar::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--primary);
  animation: ripple 1.6s ease-out infinite;
}
@keyframes ripple {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.installing-box {
  width: 100%;
  padding: 20px;
  background: #F9FAFB;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

/* QR 코드 화면 (PC용) */
.qr-container {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: inline-block;
  margin: 16px 0 20px;
}

/* 하단 보조 안내 */
.footer-help {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.footer-help a {
  color: var(--text-sub);
  text-decoration: underline;
  cursor: pointer;
}

/* 접이식 가이드 */
.faq-accordion {
  margin-top: 16px;
  width: 100%;
  text-align: left;
}
.faq-toggle {
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-weight: 600;
}
.faq-content {
  display: none;
  font-size: 12px;
  color: var(--text-sub);
  padding: 8px 0 14px;
  line-height: 1.6;
}
.faq-content.open {
  display: block;
}

/* ==========================================================================
   설치 완료 후 앱 프로모션 모달 다이얼로그 (Dialog)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: #FFFFFF;
  width: 100%;
  max-width: 360px;
  border-radius: 24px;
  padding: 28px 22px 22px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: modalPopUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes modalPopUp {
  from { transform: scale(0.92) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.modal-logo-img {
  max-width: 190px;
  max-height: 48px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.modal-icon-bubble {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.15);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.4px;
  margin-bottom: 12px;
}

.modal-message {
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.55;
  margin-bottom: 22px;
  word-break: keep-all;
}

.modal-message strong {
  color: var(--text-main);
  font-weight: 600;
}

.modal-highlight {
  display: inline-block;
  margin-top: 4px;
  font-weight: 700;
  color: var(--primary);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.btn-text-sub {
  background: transparent;
  border: none;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.btn-text-sub:hover {
  color: var(--text-sub);
  text-decoration: underline;
}

/* ==========================================================================
   데이터 로밍 켜기 시각 일러스트 가이드 카드 (성공 화면)
   ========================================================================== */
.roaming-guide-card {
  width: 100%;
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  margin-bottom: 20px;
}

.roaming-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  color: #1E40AF;
}

.step-tag {
  background: #2563EB;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.roaming-toggle-mockup {
  background: #FFFFFF;
  border: 1px solid #DBEAFE;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
  margin-bottom: 10px;
}

.toggle-info {
  display: flex;
  flex-direction: column;
}

.toggle-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.toggle-hint {
  font-size: 11.5px;
  color: #2563EB;
  font-weight: 600;
  margin-top: 2px;
}

.toggle-switch-on {
  width: 50px;
  height: 28px;
  background-color: #10B981; /* 활성화된 스위치 그린 */
  border-radius: 20px;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
  animation: togglePulse 2s infinite ease-in-out;
}

@keyframes togglePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); box-shadow: 0 0 12px rgba(16, 185, 129, 0.4); }
}

.toggle-knob {
  width: 24px;
  height: 24px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  right: 2px; /* ON 상태: 오른쪽 배치 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.roaming-safe-badge {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: #1E3A8A;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   미지원 기기 확인 및 지원 기기 목록 모달
   ========================================================================== */
.compat-modal-card {
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
}

.device-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}

.device-category {
  background: #F8F9FA;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}

.device-cat-title {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  font-size: 12.5px;
}

.support-ok {
  color: #047857;
  margin-bottom: 2px;
}

.support-no {
  color: #B91C1C;
}

/* ==========================================================================
   0. PC 테스트 모드 전용 안내 배너 (test 아규먼트 실행 시)
   ========================================================================== */
.test-banner {
  background: #F3E8FF;
  border: 1.5px solid #C084FC;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  text-align: left;
}

.test-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.test-badge {
  background: #9333EA;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: -0.2px;
}

.test-sub {
  font-size: 11px;
  color: #7E22CE;
  font-weight: 600;
}

.test-desc {
  font-size: 12px;
  color: #581C87;
  line-height: 1.45;
  margin-bottom: 10px;
}

.test-desc code {
  background: rgba(147, 51, 234, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  color: #6B21A8;
}

.test-actions {
  display: flex;
  gap: 8px;
}

.test-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.test-btn.primary {
  background: #9333EA;
  color: #FFFFFF;
}

.test-btn.primary:hover {
  background: #7E22CE;
}

.test-btn.secondary {
  background: #E9D5FF;
  color: #6B21A8;
}

.test-btn.secondary:hover {
  background: #DDD6FE;
}

/* 하단 다국어 텍스트 링크 선택기 (Language Switcher: 텍스트 링크 & 센터 정렬) */
.footer-lang-switcher {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.footer-lang-switcher .lang-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 3px 5px;
  border-radius: 4px;
  font-family: inherit;
  transition: all 0.15s ease;
  display: inline-block;
  cursor: pointer;
}

.footer-lang-switcher .lang-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-lang-switcher .lang-link.active {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
}

.footer-lang-switcher .lang-divider {
  color: #D1D5DB;
  font-size: 11px;
  user-select: none;
}
