/* ===================================================
   iOS & 모바일 최적화 프리미엄 쿠폰 등록 센터 스타일시트
   =================================================== */

:root {
  --bg-main: #0a0d14;
  --bg-card: rgba(18, 24, 38, 0.78);
  --bg-card-hover: rgba(24, 32, 50, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.6);
  
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --primary-glow: rgba(99, 102, 241, 0.35);
  --success-glow: rgba(16, 185, 129, 0.3);
  --error-glow: rgba(239, 68, 68, 0.25);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --font-base: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-code: 'Outfit', 'Pretendard', monospace;
}

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

body {
  font-family: var(--font-base);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ================= Ambient Glow Effects ================= */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.glow-1 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
  top: -100px;
  left: 50%;
  transform: translateX(-60%);
}

.glow-2 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #9333ea 0%, transparent 70%);
  bottom: 10%;
  right: -80px;
}

.glow-3 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  bottom: 40%;
  left: -90px;
}

/* ================= Layout Container ================= */
.page-container {
  width: 100%;
  max-width: 480px;
  padding: 32px 20px max(40px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
}

/* ================= Header ================= */
.page-header {
  text-align: center;
  margin-bottom: 8px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background-color: #6366f1;
  border-radius: 50%;
  box-shadow: 0 0 8px #6366f1;
  animation: pulse-dot 2s infinite;
}

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

.main-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
  word-break: keep-all;
}

.subtitle strong {
  color: #a5b4fc;
  font-weight: 600;
}

/* ================= Card Container ================= */
.card-container {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.5);
  transition: border-color 0.2s ease;
}

/* ================= Form Elements ================= */
.redeem-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.required-star {
  color: #f43f5e;
}

.text-link-btn {
  background: none;
  border: none;
  color: #818cf8;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.text-link-btn:hover {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.1);
}

/* Platform Tabs */
.platform-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-md) - 4px);
  color: var(--text-dim);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: rgba(99, 102, 241, 0.22);
  color: #e0e7ff;
  border: 1px solid rgba(99, 102, 241, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.tab-btn:not(.active):hover {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

/* Input Styles */
.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
}

.form-control {
  width: 100%;
  padding: 13px 16px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9375rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--border-active);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control::placeholder {
  color: #475569;
}

.code-input {
  font-family: var(--font-code);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.0625rem;
}

.input-clear-btn {
  position: absolute;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.input-clear-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.4;
  padding-left: 2px;
}

/* Select Wrapper */
.select-wrapper {
  position: relative;
}

.select-control {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 36px;
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: var(--text-dim);
  pointer-events: none;
}

/* ================= Error Banner ================= */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  animation: slide-in 0.2s ease;
}

.error-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-text {
  word-break: keep-all;
  line-height: 1.45;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= Submit Button ================= */
.submit-btn {
  margin-top: 6px;
  width: 100%;
  padding: 15px;
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 1.0625rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px var(--primary-glow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--primary-glow);
  filter: brightness(1.08);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(1px);
  filter: brightness(0.96);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-loader {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ================= Notice Card ================= */
.notice-card {
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
}

.notice-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.notice-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #cbd5e1;
}

.notice-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notice-list li {
  position: relative;
  padding-left: 14px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  word-break: keep-all;
}

.notice-list li::before {
  content: "•";
  position: absolute;
  left: 2px;
  top: -1px;
  color: #6366f1;
  font-size: 0.9rem;
}

.notice-list li strong {
  color: #e2e8f0;
}

/* ================= Footer ================= */
.page-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding-top: 6px;
}

/* ================= Modals ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fade-backdrop 0.2s ease;
}

@keyframes fade-backdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 400px;
  background: #131b2c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.65);
  animation: scale-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  text-align: center;
}

@keyframes scale-up {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.success-icon-wrap {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px var(--success-glow);
}

.modal-sparkle {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 1.25rem;
  animation: float 2s infinite ease-in-out;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.modal-title {
  font-size: 1.375rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.highlight-text {
  color: #38bdf8;
}

/* Reward Box */
.reward-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
}

.reward-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.reward-label {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.reward-coupon-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #f1f5f9;
}

.reward-code-badge {
  font-family: var(--font-code);
  font-size: 0.8125rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.reward-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 12px 0;
}

.reward-items-header {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.items-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-badge-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.item-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #e2e8f0;
}

.item-count {
  font-family: var(--font-code);
  font-size: 0.875rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.primary-btn {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.primary-btn:hover {
  filter: brightness(1.1);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Guide Modal */
.guide-card {
  text-align: left;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #fff;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-weight: 700;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-text strong {
  display: block;
  font-size: 0.9375rem;
  color: #f1f5f9;
  margin-bottom: 2px;
}

.step-text p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Utilities */
.hidden {
  display: none !important;
}

.mt-2 {
  margin-top: 8px;
}
