:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-900: #0f172a;
  --gray-950: #020617;
  --blue-50: #eff6ff;
  --blue-600: #2563eb;
  
  --mesh-color-1: #4facfe;
  --mesh-color-2: #00f2fe;
  --mesh-color-3: #fdfbfb;
  --brand-green: #caff00;
  --brand-ink: #0d100b;
}

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

body {
  font-family: var(--font);
  color: var(--gray-900);
  background-color: var(--gray-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* DOTS BACKGROUND (Konnect Style) */
.dots-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--gray-50);
  background-image: radial-gradient(var(--gray-200) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* BRAND HEADER */
.brand-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; padding: 0 16px;
  opacity: 0; /* GSAP will fade in */
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 22px; letter-spacing: -0.04em; color: var(--brand-ink); }
.logo svg { width: 22px; height: 22px; color: var(--brand-ink); fill: var(--brand-green); }
.secure-tag {
  display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--brand-ink);
  background: var(--white); border: 1px solid var(--gray-200); padding: 6px 14px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em;
}
.secure-tag svg { width: 14px; height: 14px; color: #10b981; }

/* MAIN CONTAINER */
main {
  flex: 1; width: 100%; max-width: 500px; margin: 0 auto;
  padding: 40px 20px; display: flex; flex-direction: column; justify-content: center;
}

/* KONNECT STYLE CARD */
.card {
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.05);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  position: relative;
  opacity: 0; transform: translateY(30px); /* GSAP will animate */
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), box-shadow 0.4s cubic-bezier(0.16,1,0.3,1);
}
.card:hover {
  transform: translateY(-4px) rotate(0.5deg);
  box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}

/* 3D FLOATING CREDIT CARD */
.card-3d-wrapper {
  perspective: 1000px;
  padding: 40px 40px 10px;
  display: flex; justify-content: center;
  opacity: 0; transform: scale(0.9); /* GSAP */
}
.card-3d {
  width: 280px; height: 170px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
  padding: 20px;
  color: white;
  transform-style: preserve-3d;
}
.card-3d-chip {
  width: 40px; height: 30px;
  background: linear-gradient(135deg, #ffd700, #daa520);
  border-radius: 6px;
  position: absolute; top: 30px; left: 24px;
  transform: translateZ(20px);
}
.card-3d-wifi {
  position: absolute; top: 34px; left: 74px;
  transform: translateZ(10px);
  color: rgba(255,255,255,0.8);
}
.card-3d-wifi svg { width: 20px; height: 20px; }
.card-3d-name {
  position: absolute; bottom: 20px; left: 24px;
  font-weight: 600; font-size: 14px; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.9);
  transform: translateZ(25px);
}
.card-3d-logo {
  position: absolute; bottom: 20px; right: 24px;
  font-weight: 800; font-size: 16px; letter-spacing: -0.02em;
  transform: translateZ(30px);
}

/* CONTENT */
.card-header { padding: 20px 32px 16px; text-align: center; }
.card-title { font-size: 24px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.03em; margin-bottom: 6px; }
.card-desc { font-size: 15px; color: var(--gray-600); font-weight: 500; }
.card-body { padding: 0 32px 32px; }

/* APPLE AMOUNT DISPLAY */
.apple-amount-display { text-align: center; padding: 10px 0 30px; }
.input-wrapper { display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.val-input {
  font-size: 64px; font-weight: 800; color: var(--gray-900);
  letter-spacing: -0.04em; line-height: 1; border: none; background: transparent;
  width: 80px; text-align: right; outline: none; font-family: inherit; padding: 0;
  transition: width 0.15s cubic-bezier(0.16,1,0.3,1);
}
.currency-label { font-size: 24px; font-weight: 700; color: var(--gray-400); margin-left: 8px; padding-top: 24px; }
.suggestion-box { font-size: 14px; color: var(--gray-500); margin-bottom: 16px; font-weight: 500; animation: fadeUp 0.2s ease; }
.suggestion-btn {
  background: rgba(37,99,235,0.1); color: var(--blue-600); border: none;
  padding: 6px 12px; border-radius: 12px; font-weight: 700; cursor: pointer;
  margin-left: 8px; font-size: 13px; transition: all 0.2s;
}
.suggestion-btn:hover { background: rgba(37,99,235,0.15); transform: translateY(-1px); }
.edit-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.04); color: var(--gray-900);
  font-size: 14px; font-weight: 700; padding: 10px 18px;
  border-radius: 20px; cursor: pointer; border: none;
  transition: background 0.2s;
}
.edit-btn:hover { background: rgba(0,0,0,0.08); }
.edit-btn svg { width: 14px; height: 14px; }

/* PRIMARY BUTTON (KONNECT STYLE) */
.btn-primary {
  width: 100%; background: var(--brand-green); color: var(--brand-ink);
  border: none; padding: 18px; border-radius: 999px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
  position: relative; overflow: hidden;
}
.btn-primary:hover:not(:disabled) { filter: brightness(0.95); transform: translateY(-1px); box-shadow: 0 10px 20px rgba(202,255,0,0.2); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { background: var(--gray-100); color: var(--gray-400); cursor: not-allowed; box-shadow: none; transform: none; filter: none; }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }
.btn-text { white-space: nowrap; }
.btn-loader { width: 24px; height: 24px; }

/* SHARE BUTTON */
.share-wrapper { text-align: center; margin-top: 16px; position: relative; }
.share-btn {
  background: transparent; border: none; color: var(--gray-500); font-size: 14px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: color 0.2s;
  width: 100%; padding: 8px;
}
.share-btn:hover { color: var(--blue-600); }
.share-btn svg { width: 16px; height: 16px; }
.share-tooltip {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--gray-900); color: white; padding: 6px 12px; border-radius: 8px;
  font-size: 12px; margin-bottom: 4px; animation: fadeUp 0.2s; white-space: nowrap; font-weight: 600;
}

/* ERROR MSG */
.error-msg { text-align: center; color: #ef4444; font-size: 14px; font-weight: 600; margin-top: 16px; background: #fef2f2; padding: 12px; border-radius: 12px; }
.hidden { display: none !important; }

/* TRUST FOOTER */
.trust {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 16px 28px; background: rgba(255,255,255,0.4); border-top: 1px solid rgba(255,255,255,0.5);
}
.trust-item { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--gray-500); }
.trust-item svg { width: 14px; height: 14px; color: var(--gray-400); }

.trust-logos {
  display: flex; justify-content: center; align-items: center;
  padding: 0 28px 16px; background: rgba(255,255,255,0.4);
}
.trust-logos-img {
  max-width: 100%; height: auto; max-height: 28px; opacity: 0.6; filter: grayscale(100%); transition: all 0.3s;
}
.trust-logos:hover .trust-logos-img { opacity: 1; filter: grayscale(0%); }

/* INFO CARD (KONNECT STYLE) */
.info-card {
  margin-top: 24px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
  transition: transform 0.3s ease;
}
.info-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.04); }
.info-header {
  display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--brand-ink);
  margin-bottom: 16px; font-size: 16px; letter-spacing: -0.01em;
}
.info-header svg { width: 20px; height: 20px; color: var(--brand-ink); fill: var(--brand-green); }
.info-body p {
  font-size: 13.5px; color: var(--gray-600); line-height: 1.6; margin-bottom: 12px; font-weight: 500;
}
.info-body p:last-child { margin-bottom: 0; }
.info-body strong { color: var(--gray-900); font-weight: 700; }

/* FOOTER */
footer { text-align: center; padding: 24px; font-size: 13px; color: var(--gray-500); font-weight: 500; }

/* IOS SHEET */
.ios-sheet-overlay {
  position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity 0.3s;
  display: flex; align-items: flex-end; justify-content: center;
}
.ios-sheet-overlay.active { opacity: 1; visibility: visible; }
.ios-sheet {
  width: 100%; max-width: 500px; background: rgba(255,255,255,0.9);
  backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
  border-radius: 32px 32px 0 0; padding: 24px 0 40px;
  transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.1); max-height: 80vh; display: flex; flex-direction: column;
}
.ios-sheet-overlay.active .ios-sheet { transform: translateY(0); }
.ios-sheet-header { text-align: center; padding: 0 24px 20px; border-bottom: 1px solid rgba(0,0,0,0.08); position: relative; }
.ios-sheet-title { font-size: 17px; font-weight: 700; color: var(--gray-900); }
.ios-sheet-close {
  position: absolute; right: 24px; top: -4px;
  background: rgba(0,0,0,0.05); border: none; width: 30px; height: 30px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--gray-600); transition: background 0.2s;
}
.ios-sheet-close:hover { background: rgba(0,0,0,0.1); }
.ios-sheet-list { overflow-y: auto; padding: 10px 24px; flex: 1; -webkit-overflow-scrolling: touch; }
.ios-sheet-item {
  padding: 16px 0; border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 20px; font-weight: 600; color: var(--gray-900);
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; transition: background 0.2s;
}
.ios-sheet-item:last-child { border-bottom: none; }
.ios-sheet-item.selected { color: var(--blue-600); }
.ios-sheet-item.selected::after {
  content: ''; display: block; width: 24px; height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
}

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px);
  z-index: 2000; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-container {
  background: #fff; width: 100%; max-width: 600px; height: 90vh;
  border-radius: 24px 24px 0 0; display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.modal-overlay.active .modal-container { transform: translateY(0); }
.modal-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.modal-bar-left { display: flex; align-items: center; gap: 12px; }
.modal-bar-dot { width: 32px; height: 32px; border-radius: 8px; background: #10b981; display: flex; align-items: center; justify-content: center; }
.modal-bar-dot::after { content: ''; width: 12px; height: 12px; background: white; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/cover; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/cover; }
.modal-bar-label { font-size: 14px; font-weight: 700; color: #0f172a; }
.modal-bar-url { font-size: 12px; color: #64748b; font-weight: 500; }
.modal-close { background: none; border: none; cursor: pointer; color: #64748b; padding: 4px; }
.modal-close svg { width: 20px; height: 20px; }
.modal-frame { flex: 1; position: relative; background: #fff; }
.modal-frame iframe { width: 100%; height: 100%; border: none; position: relative; z-index: 2; }
.modal-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; z-index: 1; }
.modal-loading-spinner { width: 40px; height: 40px; border: 3px solid #f1f5f9; border-top-color: #2563eb; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 16px; }
.modal-loading-text { font-size: 14px; font-weight: 600; color: #64748b; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal-footer { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: #f8fafc; border-top: 1px solid #e2e8f0; font-size: 13px; font-weight: 600; color: #64748b; }
.modal-footer-left { display: flex; align-items: center; gap: 8px; color: #10b981; }
.modal-footer-left svg { width: 16px; height: 16px; }
.modal-external { display: flex; align-items: center; gap: 4px; color: #2563eb; text-decoration: none; }
.modal-external svg { width: 14px; height: 14px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
