/* makelinker.css – QR 자동 생성 페이지 공통 스타일 (반응형 포함) */

/* 레이아웃 */
.content {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 40px;
}


.back-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  background: var(--card);
  color: var(--primary);
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: all .2s;
}
.back-btn:hover {
  transform: translateX(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

/* Header */
.header {
  text-align: center;
  padding: 84px 20px 24px; /* 상단 고정 버튼 고려해 여백 증가 */
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  margin-bottom: 24px;
}


/* 섹션 공통 */
.phone-section,
.generation-section,
#qr-codes-section,
.phone-info-section {
  background:#fff;
  border:1px solid #e6e0ea;
  border-radius:16px;
  padding:22px 24px 26px;
  box-shadow:0 4px 18px rgba(0,0,0,.06);
  margin-bottom:24px;
}

/* 헤더 */
.phone-section h2,
.generation-section h3 {
  margin:0 0 16px;
  font-size:20px;
  font-weight:700;
  letter-spacing:-0.3px;
  color:#222;
}

/* 인풋 그룹 */
.input-group {
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:nowrap;
  margin-bottom:10px;
}
.phone-input {
  flex:1 1 auto;
  height:48px;
  padding:12px 16px;
  font-size:16px;
  border:1px solid #cfc8d9;
  border-radius:14px;
  transition:border-color .2s, box-shadow .2s;
}
.phone-input:focus {
  outline:none;
  border-color:#8f5bb2;
  box-shadow:0 0 0 3px rgba(143,91,178,.18);
}
.search-btn {
  height:48px;
  padding:0 24px;
  font-size:16px;
  font-weight:600;
  background:#6f3fa3;
  color:#fff;
  border:none;
  border-radius:14px;
  cursor:pointer;
  transition:background .15s;
}
.search-btn:hover { background:#5a2f8a; }
.search-btn:disabled { background:#aaa; cursor:default; }

/* 수량 선택 */
.quantity-selector select {
  width:160px;
  height:44px;
  border:1px solid #cfc8d9;
  border-radius:12px;
  padding:0 10px;
  font-size:15px;
}

/* 로딩 */
.loading { display:none; text-align:center; margin:30px 0; }
.loading.show { display:block; }
.spinner {
  width:52px; height:52px;
  border:6px solid #e6e0ea;
  border-top-color:#6f3fa3;
  border-radius:50%;
  animation:spin 0.9s linear infinite;
  margin:0 auto 14px;
}
@keyframes spin { to { transform:rotate(360deg); } }

/* QR 그리드 */
.qr-grid {
  display:grid;
  gap:18px;
  grid-template-columns:repeat(auto-fill, minmax(200px,1fr));
}
.qr-card {
  background:#fff;
  border:1px solid #e2ddee;
  border-radius:14px;
  padding:14px 14px 18px;
  box-shadow:0 2px 10px rgba(0,0,0,.05);
  text-align:center;
  position:relative;
}
.qr-card h6 {
  margin: 10px 0 5px;
  font-size: 16px;
  color: #333;
  font-weight: 600;
  transition: color 0.2s, background-color 0.2s;
  padding: 4px 8px;
  border-radius: 4px;
}
.qr-card h6[onclick] {
  cursor: pointer;
  user-select: none;
}
.qr-card h6[onclick]:hover {
  color: #8f5bb2;
  background-color: #f5f3f7;
}
.qr-card h6[onclick]:active {
  background-color: #e6e0ea;
}
.qr-code-text {
  font-size:12px;
  color:#666;
  letter-spacing:0.5px;
  margin:0 0 10px;
  word-break:break-all;
}
.qr-code-canvas {
  width:200px;
  height:245px;
  display:block;
  margin:0 auto;
  max-width:200px;
  aspect-ratio:200/245;
  height:auto !important;
  box-shadow:0 0 0 3px rgba(0,0,0,.1);
}

/* 작은 버튼 그룹 */
.btn-group-sm {
  display:flex;
  gap:6px;
  justify-content:center;
  flex-wrap:wrap;
}
.btn-sm {
  border:none;
  border-radius:10px;
  padding:8px 12px;
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  transition:background .15s;
}
.btn-primary { background:#6f3fa3; color:#fff; }
.btn-primary:hover { background:#5a2f8a; }
.btn-info { background:#17a2b8; color:#fff; }
.btn-info:hover { background:#13899a; }

/* 인증된 전화번호 카드 */
.phone-info-section h4 {
  margin:0 0 6px;
  font-size:16px;
  font-weight:700;
}
.phone-info-section p { margin:2px 0; }

/* 관리자 모드 강조 */
.admin-active .generation-section {
  border:2px solid #ffb347;
  box-shadow:0 4px 20px rgba(255,179,71,0.25);
}
.admin-active #limit-hint {
  color:#d97a00 !important;
  font-weight:600;
}

/* 페이드 인 */
.fade-in { animation:fadeIn .35s ease; }
@keyframes fadeIn {
  from { opacity:0; transform:translateY(4px); }
  to { opacity:1; transform:translateY(0); }
}

/* 통일된 대형 액션 버튼 스타일 */
.action-buttons-stack,
.action-buttons-row {
  display:flex;
  flex-direction:column;
  gap:14px;
  margin:28px 0 8px;
}

.action-buttons-stack .big-btn {
  display:block;
  width:100%;
  max-width:100%;
  padding:18px 20px;
  font-size:18px;
  font-weight:700;
  line-height:1.2;
  border:none;
  border-radius:28px;
  text-align:center;
  cursor:pointer;
  box-sizing:border-box;
  transition:transform .15s, box-shadow .15s;
}

.big-btn.teal   { background:#0097b5; color:#fff; }
.big-btn.purple { background:#6f3fa3; color:#fff; }
.big-btn.teal:hover,
.big-btn.purple:hover { box-shadow:0 4px 14px rgba(0,0,0,.12); transform:translateY(-2px); }

.big-btn:active { transform:translateY(0); box-shadow:0 2px 8px rgba(0,0,0,.1); }

/* 아이콘 정렬 */
.big-btn .icon {
  display:inline-block;
  margin-right:6px;
  vertical-align:middle;
}

/* 모바일 폭 문제 해결 및 고정 폭 */
@media (max-width:640px){
  .action-buttons-stack .big-btn {
    width:100%;
    border-radius:24px;
    font-size:16px;
    padding:16px 18px;
  }
}

/* 기존 뒤섞인 버튼 너비 리셋 (겹침 방지) */
.action-buttons-stack a,
.action-buttons-stack button {
  box-sizing:border-box;
}

/* 서로 다른 padding/width 가진 기존 스타일 무효화 */
.action-buttons-stack .btn,
.action-buttons-row .btn {
  width:100% !important;
  margin:0 !important;
  padding:0 !important;
}

/* 반응형 */
@media (max-width:860px){
  .input-group { flex-direction:column; align-items:stretch; }
  .search-btn, .phone-input { width:100%; }
}
@media (max-width:640px){
  .content { padding:0 14px 32px; }
  .phone-section,
  .generation-section,
  #qr-codes-section,
  .phone-info-section {
    padding:18px 16px 22px;
    border-radius:14px;
  }
  .input-group { gap:10px; }
  .quantity-selector select { width:100%; }
  .qr-grid { grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:14px; }
  .qr-card { padding:12px 12px 16px; }
  .qr-code-canvas { width:160px; height:200px; }
}

/* 초소형 */
@media (max-width:380px){
  .search-btn { height:44px; font-size:15px; }
  .phone-input { height:44px; font-size:15px; }
  .qr-code-canvas { width:140px; height:180px; }
}

/* 모바일에서 카드 잘림 방지 */
*,
*::before,
*::after { box-sizing:border-box; }

@media (max-width:640px){
  body, html { width:100%; overflow-x:hidden; }
  .content { padding:0 14px 32px; }

    .back-btn {
    top: 12px;
    left: 12px;
    padding: 8px 12px;
    font-size: 13px;
  }
  /* 그리드 폭 강제 100% + 최소열 크기 축소 */
  .qr-grid {
    display:grid;
    gap:14px;
    grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
    width:100%;
  }

  .qr-card {
    width:100%;
    max-width:100%;
    overflow:hidden;
  }

  /* 캔버스가 부모 너비 넘지 않도록 */
  .qr-code-canvas {
    width:100% !important;
    height:auto !important;
    max-width:200px;
    aspect-ratio:200/245;
    display:block;
    margin:0 auto;
  }

  /* 버튼 줄바꿈 허용 */
  .btn-group-sm {
    flex-wrap:wrap;
  }

  /* 긴 텍스트 줄바꿈 */
  .qr-code-text {
    word-break:break-all;
  }
}

@media (max-width:380px){
  .qr-grid {
    grid-template-columns:1fr;
  }
  .qr-code-canvas {
    max-width:160px;
  }
}
