@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #f5f7fa;
  --fg: #1a2332;
  --card: #ffffff;
  --card-fg: #1a2332;
  --primary: hsl(211,100%,25%);
  --primary-fg: #fff;
  --secondary: hsl(30,100%,50%);
  --secondary-fg: #fff;
  --muted: #f0f2f5;
  --muted-fg: #6b7a8d;
  --border: #e2e6eb;
  --success: hsl(160,84%,39%);
  --success-fg: #fff;
  --destructive: hsl(0,84%,60%);
  --destructive-fg: #fff;
  --radius: 0.75rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ===== Utilities ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 768px; margin: 0 auto; padding: 0 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.text-center { text-align: center; }
.text-xs { font-size: 0.6875rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.min-h-screen { min-height: 100vh; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-50 { z-index: 50; }
.overflow-hidden { overflow: hidden; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: var(--radius); }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.shadow-md { box-shadow: 0 4px 12px -2px rgba(26,35,50,0.08); }
.shadow-lg { box-shadow: 0 12px 32px -4px rgba(26,35,50,0.12); }
.shadow-xl { box-shadow: 0 20px 48px -8px rgba(26,35,50,0.16); }
.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.bg-card { background: var(--card); }
.bg-muted { background: var(--muted); }
.text-muted { color: var(--muted-fg); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-destructive { color: var(--destructive); }
.text-secondary { color: var(--secondary); }

/* ===== Components ===== */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius); font-weight: 600; font-size: 0.875rem;
  border: none; transition: all 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { opacity: 0.9; }
.btn-success { background: var(--success); color: var(--success-fg); }
.btn-success:hover { opacity: 0.9; }
.btn-secondary { background: var(--secondary); color: var(--secondary-fg); }
.btn-secondary:hover { opacity: 0.9; }
.btn-outline { background: transparent; color: var(--fg); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--muted); }
.btn-ghost { background: transparent; color: var(--muted-fg); border: none; }
.btn-ghost:hover { background: var(--muted); color: var(--fg); }
.btn-destructive { background: var(--destructive); color: var(--destructive-fg); }
.btn-lg { padding: 16px 24px; font-size: 1rem; font-weight: 700; border-radius: 1rem; }
.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-icon { padding: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Inputs */
.input, .select-input, .textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.875rem; background: var(--card); color: var(--fg); transition: border-color 0.2s;
  outline: none;
}
.input:focus, .select-input:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,51,128,0.1); }
.textarea { resize: vertical; min-height: 80px; }
.label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--fg); margin-bottom: 6px; }

/* Cards */
.card { background: var(--card); border-radius: 1rem; box-shadow: 0 4px 12px -2px rgba(26,35,50,0.08); overflow: hidden; }
.card-header { padding: 20px 20px 12px; display: flex; align-items: center; gap: 10px; }
.card-body { padding: 0 20px 20px; }
.card-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Info blocks */
.info-block { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--muted); }
.info-block .info-label { font-size: 0.6875rem; font-weight: 500; color: var(--muted-fg); text-transform: uppercase; letter-spacing: 0.05em; }
.info-block .info-value { font-size: 0.875rem; font-weight: 600; color: var(--fg); }
.info-icon { color: var(--primary); margin-top: 2px; flex-shrink: 0; }
.info-icon.secondary { color: var(--secondary); }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
@media (min-width: 640px) and (max-width: 768px) { .grid-2 { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(3,1fr); } }

/* Section */
.section { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: 0 4px 12px -2px rgba(26,35,50,0.08); }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 1.125rem; font-weight: 600; color: var(--fg); margin-bottom: 16px; }

/* Switch */
.switch { position: relative; width: 44px; height: 24px; background: var(--border); border-radius: 12px; cursor: pointer; transition: background 0.2s; border: none; padding: 0; flex-shrink: 0; }
.switch.active { background: var(--success); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: white; border-radius: 50%; transition: transform 0.2s; }
.switch.active::after { transform: translateX(20px); }

/* Payment option box */
.payment-box { border: 1px solid var(--border); border-radius: 0.5rem; padding: 16px; margin-bottom: 16px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
.modal-content { position: relative; width: 100%; max-width: 28rem; background: var(--card); border-radius: 1.5rem 1.5rem 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,0.2); max-height: 95vh; overflow-y: auto; animation: slideUp 0.4s ease-out; }
@media (min-width: 640px) { .modal-overlay { align-items: center; padding: 16px; } .modal-content { border-radius: 1rem; } }
.modal-header { padding: 20px; text-align: center; position: relative; }
.modal-body { padding: 20px; }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: rgba(255,255,255,0.6); cursor: pointer; }
.modal-close:hover { color: white; }

/* QR wrapper */
.qr-wrapper { display: flex; justify-content: center; }
.qr-box { background: white; padding: 20px; border-radius: 1rem; box-shadow: inset 0 2px 4px rgba(0,0,0,0.06); }

/* Timer */
.timer-box { text-align: center; border-radius: var(--radius); padding: 12px 16px; transition: background 0.3s; }
.timer-box.ok { background: rgba(16,185,129,0.1); }
.timer-box.urgent { background: rgba(239,68,68,0.1); }
.timer-value { font-weight: 800; font-size: 1.25rem; }
.timer-value.ok { color: var(--success); }
.timer-value.expired, .timer-value.urgent-text { color: var(--destructive); }
.timer-label { font-size: 0.875rem; font-weight: 600; margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.timer-urgent-msg { color: var(--destructive); font-size: 0.75rem; margin-top: 4px; animation: pulseSoft 1.5s ease-in-out infinite; }

/* Step */
.step { display: flex; align-items: center; gap: 12px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; color: white; }
.step-num.primary { background: var(--primary); }
.step-num.secondary { background: var(--secondary); }
.step-text { font-size: 0.875rem; color: var(--fg); }

/* Code input */
.code-field { position: relative; }
.code-input { width: 100%; background: var(--muted); color: var(--fg); font-size: 0.75rem; font-family: monospace; padding: 12px 48px 12px 12px; border-radius: var(--radius); border: 1px solid var(--border); }
.code-copy-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 8px; border-radius: 8px; border: none; transition: all 0.2s; }
.code-copy-btn.idle { background: var(--primary); color: var(--primary-fg); }
.code-copy-btn.copied { background: var(--success); color: var(--success-fg); }

/* Trust badges */
.trust-badges { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 24px; padding: 20px 0; font-size: 0.75rem; color: var(--muted-fg); }
.trust-badge { display: flex; align-items: center; gap: 6px; }
.trust-badge svg { color: var(--success); }

/* Hero */
.hero { position: relative; height: 24rem; overflow: hidden; }
@media (min-width: 640px) { .hero { height: 32rem; } }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity 0.7s; }
.hero-gradient { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.3), transparent); }
.hero-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 20px 24px; }
.hero-subtitle { color: rgba(255,255,255,0.7); font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.hero-title { font-size: 1.5rem; font-weight: 800; color: white; }
@media (min-width: 640px) { .hero-title { font-size: 1.875rem; } }
.hero-price { position: absolute; top: 16px; right: 56px; background: var(--secondary); color: var(--secondary-fg); padding: 8px 16px; border-radius: var(--radius); font-weight: 800; font-size: 1.125rem; box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 10; }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.4); color: white; border: none; border-radius: 50%; padding: 6px; z-index: 10; transition: background 0.2s; }
.hero-arrow:hover { background: rgba(0,0,0,0.6); }
.hero-arrow.left { left: 8px; }
.hero-arrow.right { right: 8px; }
.hero-dots { position: absolute; bottom: 56px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 10; }
@media (min-width: 640px) { .hero-dots { bottom: 64px; } }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.5); border: none; cursor: pointer; transition: all 0.2s; padding: 0; }
.hero-dot.active { background: white; width: 16px; }
.hero-badges { display: none; }
@media (min-width: 640px) { .hero-badges { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,0.6); font-size: 0.75rem; } }

/* Payment selection cards */
.pay-card { width: 100%; background: var(--card); border-radius: 1rem; padding: 20px; box-shadow: 0 4px 12px -2px rgba(26,35,50,0.08); border: 2px solid transparent; transition: all 0.2s; text-align: left; cursor: pointer; }
.pay-card:hover { border-color: rgba(0,51,128,0.3); box-shadow: 0 12px 32px -4px rgba(26,35,50,0.12); }
.pay-card-icon { width: 56px; height: 56px; border-radius: 1rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.2s; }
.pay-card:hover .pay-card-icon { transform: scale(1.1); }
.pay-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pay-tag { font-size: 0.625rem; font-weight: 600; padding: 2px 8px; border-radius: 9999px; background: var(--muted); color: var(--muted-fg); }

/* Price summary */
.price-row { display: flex; justify-content: space-between; font-size: 0.875rem; padding: 2px 0; }
.price-total { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; }
.price-total-label { font-weight: 700; font-size: 1.125rem; }
.price-total-value { font-weight: 800; font-size: 1.5rem; color: var(--primary); }
.line-through { text-decoration: line-through; }

/* Admin header */
.admin-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); }
.admin-header-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.admin-nav { display: flex; gap: 4px; }

/* Admin link cards */
.link-card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: 0 4px 12px -2px rgba(26,35,50,0.08); transition: box-shadow 0.2s; }
.link-card:hover { box-shadow: 0 12px 32px -4px rgba(26,35,50,0.12); }
.link-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; font-size: 0.875rem; margin-bottom: 12px; }
@media (min-width: 768px) { .links-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; } }
.links-grid { display: grid; gap: 16px; }

.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 9999px; }
.badge-success { background: rgba(16,185,129,0.1); color: var(--success); }
.badge-danger { background: rgba(239,68,68,0.1); color: var(--destructive); }
.code-tag { font-size: 0.75rem; font-family: monospace; background: var(--muted); padding: 4px 8px; border-radius: 4px; }

/* Message block */
.message-block { background: var(--card); border-radius: 1rem; padding: 20px; box-shadow: 0 4px 12px -2px rgba(26,35,50,0.08); display: flex; gap: 12px; }

/* Login */
.login-bg { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; position: relative; overflow: hidden; background: linear-gradient(135deg, hsl(211,100%,20%), hsl(211,100%,25%), hsl(211,80%,35%)); }
.login-bg .bg-circle { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.05); filter: blur(60px); pointer-events: none; }
.login-card { width: 100%; max-width: 28rem; background: var(--card); border-radius: 1rem; box-shadow: 0 25px 50px rgba(0,0,0,0.25); padding: 32px 40px; position: relative; z-index: 1; border: 1px solid rgba(255,255,255,0.1); }
.login-icon-wrap { display: flex; justify-content: center; margin-bottom: 24px; }
.login-icon { width: 64px; height: 64px; border-radius: 1rem; background: rgba(0,51,128,0.1); display: flex; align-items: center; justify-content: center; }
.login-footer { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.login-footer span { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted-fg); }
.login-footer svg { color: var(--success); }
.login-bottom { text-align: center; font-size: 0.75rem; color: rgba(255,255,255,0.4); margin-top: 24px; }
.password-wrap { position: relative; }
.password-wrap .input { padding-left: 40px; padding-right: 48px; height: 48px; font-size: 1rem; }
.password-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-fg); pointer-events: none; }
.password-toggle { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted-fg); cursor: pointer; padding: 0; }
.password-toggle:hover { color: var(--fg); }
.login-error { font-size: 0.875rem; color: var(--destructive); background: rgba(239,68,68,0.1); border-radius: 8px; padding: 10px 16px; text-align: center; animation: fadeIn 0.3s; }
.login-spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseSoft { 0%,100%{opacity:1} 50%{opacity:0.7} }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-8px)} 40%,80%{transform:translateX(8px)} }
.animate-fade-in { animation: fadeIn 0.5s ease-out; }
.animate-slide-up { animation: slideUp 0.5s ease-out; }
.animate-shake { animation: shake 0.5s ease-in-out; }

/* File upload */
.file-upload { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--border); border-radius: 8px; padding: 12px; cursor: pointer; transition: all 0.2s; }
.file-upload:hover { border-color: var(--primary); background: var(--muted); }
.file-upload input { display: none; }
