/* ==========================================================================
   선생님용 학교 와이파이 IP 확인 시스템 - 모바일 최적화 프리미엄 스타일시트
   모바일 퍼스트(Mobile-First) 디자인 & iOS/Android 터치 UX 최적화
   ========================================================================== */

:root {
  /* HSL Modern Palette */
  --primary-h: 221;
  --primary: hsl(var(--primary-h), 83%, 53%);
  --primary-hover: hsl(var(--primary-h), 83%, 45%);
  --primary-light: hsl(var(--primary-h), 100%, 96%);
  --primary-glow: hsla(var(--primary-h), 83%, 53%, 0.25);

  --emerald: #059669;
  --emerald-light: #ecfdf5;
  --emerald-border: #a7f3d0;
  --emerald-glow: rgba(5, 150, 105, 0.25);

  --amber: #d97706;
  --amber-light: #fffbeb;
  --amber-border: #fde68a;

  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white:     #ffffff;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 8px 24px -4px var(--primary-glow);
  --shadow-emerald-glow: 0 8px 24px -4px var(--emerald-glow);
}

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

html {
  font-size: 16px;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
  background-color: #f8fafc;
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.07) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(5, 150, 105, 0.07) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--slate-800);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 14px calc(24px + env(safe-area-inset-bottom));
  padding-top: max(12px, env(safe-area-inset-top));
  -webkit-font-smoothing: antialiased;
}

/* 모바일 전용 컨테이너 (최대 폭 460px) */
.mobile-app-container {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 상단 모바일 앱 헤더 */
.mobile-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 2px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.brand-badge svg {
  width: 15px;
  height: 15px;
}

.guide-link-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-600);
  text-decoration: none;
  background: var(--white);
  border: 1px solid var(--slate-200);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s;
}

.guide-link-btn:active {
  background: var(--slate-100);
}

/* 타이틀 섹션 */
.mobile-hero {
  text-align: center;
  padding: 4px 6px 8px;
}

.mobile-hero h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.mobile-hero p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--slate-500);
  line-height: 1.45;
  word-break: keep-all;
}

/* 중요 안내 카드 (와이파이 연결 체크) */
.wifi-check-card {
  background: var(--amber-light);
  border: 1.5px solid var(--amber-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.wifi-check-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1.2;
}

.wifi-check-text {
  font-size: 12.5px;
  color: #78350f;
  line-height: 1.45;
  word-break: keep-all;
}

.wifi-check-text strong {
  color: #451a03;
  font-weight: 800;
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

/* 모바일 메인 카드 */
.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--emerald-light);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
}

.live-dot {
  width: 7px;
  height: 7px;
  background-color: var(--emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-icon-refresh {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  color: var(--slate-600);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-icon-refresh:active {
  background: var(--slate-200);
  transform: scale(0.96);
}

/* IP 주소 디스플레이 박스 (탭하면 복사되는 모바일 인터랙션) */
.ip-tap-box {
  background: var(--slate-900);
  border-radius: var(--radius-md);
  padding: 20px 14px;
  text-align: center;
  margin: 6px 0 14px;
  color: var(--white);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  user-select: none;
  touch-action: manipulation;
}

.ip-tap-box:active {
  transform: scale(0.98);
  background: #020617;
}

.ip-box-tag {
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 2px;
  color: var(--slate-400);
  margin-bottom: 4px;
  font-weight: 700;
}

.ip-text-large {
  font-family: 'JetBrains Mono', monospace;
  font-size: 27px;
  font-weight: 800;
  color: #34d399;
  letter-spacing: 0.5px;
  word-break: break-all;
  line-height: 1.2;
  margin: 4px 0;
}

@media (min-width: 380px) {
  .ip-text-large {
    font-size: 32px;
  }
}

.ip-box-sub {
  font-size: 11px;
  color: var(--slate-400);
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* 모바일 전용 대형 복사 버튼 */
.btn-mobile-copy {
  width: 100%;
  height: 52px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.btn-mobile-copy:active {
  transform: scale(0.97);
  background: var(--primary-hover);
}

.btn-mobile-copy.copied {
  background: var(--emerald) !important;
  box-shadow: var(--shadow-emerald-glow) !important;
}

/* 폼 영역 */
.form-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.form-header h2 {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--slate-900);
}

.form-desc {
  font-size: 12px;
  color: var(--slate-500);
  margin-bottom: 16px;
  word-break: keep-all;
}

.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--slate-700);
  margin-bottom: 5px;
}

.form-label .req {
  color: #ef4444;
}

.input-box {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--slate-400);
  pointer-events: none;
}

.m-input {
  width: 100%;
  height: 48px;
  padding: 12px 14px 12px 38px;
  font-size: 15px;
  font-family: inherit;
  background: var(--slate-50);
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  color: var(--slate-900);
  transition: all 0.15s ease;
  -webkit-appearance: none;
}

.m-input.no-icon {
  padding-left: 12px;
}

.m-input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.m-input::placeholder {
  color: var(--slate-400);
  font-size: 13.5px;
}

/* 모바일 전송 및 공유 버튼 그룹 */
.btn-mobile-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.btn-mobile-submit {
  width: 100%;
  height: 50px;
  background: var(--slate-900);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
  touch-action: manipulation;
  transition: all 0.15s;
}

.btn-mobile-submit:active {
  transform: scale(0.97);
  background: var(--slate-800);
}

.btn-mobile-share {
  width: 100%;
  height: 46px;
  background: #fee500; /* 카카오 노란색 감성 */
  color: #191919;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s;
}

.btn-mobile-share:active {
  transform: scale(0.97);
  background: #fada0a;
}

/* 완료 카드 */
.success-card {
  background: var(--emerald-light);
  border: 1.5px solid var(--emerald-border);
  border-radius: var(--radius-lg);
  padding: 22px 16px;
  text-align: center;
}

.success-icon {
  font-size: 40px;
  margin-bottom: 8px;
  line-height: 1;
}

.success-title {
  font-size: 18px;
  font-weight: 800;
  color: #065f46;
  margin-bottom: 6px;
}

.success-msg {
  font-size: 13px;
  color: #047857;
  line-height: 1.5;
  word-break: keep-all;
}

.btn-re-send {
  margin-top: 14px;
  background: none;
  border: none;
  color: #065f46;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px;
}

/* 모바일 토스트 팝업 (Toast Notification) */
.toast-notice {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.94);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  white-space: nowrap;
}

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

/* 푸터 */
.mobile-footer {
  text-align: center;
  padding: 10px 0 16px;
  font-size: 11.5px;
  color: var(--slate-400);
  line-height: 1.6;
}

.mobile-footer a {
  color: var(--slate-500);
  text-decoration: none;
  font-weight: 600;
}

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

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