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

:root {
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --blue-light: #EFF6FF;
  --navy: #0F172A;
  --slate: #64748B;
  --bg: #FFFFFF;
  --bg-gray: #F8FAFC;
  --border: #E2E8F0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,.05), 0 10px 40px rgba(0,0,0,.10);
}

html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--navy); background: var(--bg);
  line-height: 1.6; -webkit-font-smoothing: antialiased;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-size: 1.3rem; font-weight: 800; color: var(--navy); text-decoration: none; letter-spacing: -.5px; }
.logo-dot { color: var(--blue); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: var(--radius-sm); font-weight: 600;
  cursor: pointer; text-decoration: none; transition: all .15s;
  font-size: .9rem; padding: 10px 18px;
}
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-primary { background: var(--blue); color: white; box-shadow: 0 2px 8px rgba(37,99,235,.35); }
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-outline { border: 2px solid var(--blue); color: var(--blue); background: transparent; }
.btn-outline:hover { background: var(--blue-light); }
.btn-ghost { background: transparent; color: var(--slate); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-gray); color: var(--navy); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: 10px; }

/* GOOGLE BUTTON */
.btn-google {
  display: inline-flex; align-items: center; gap: 10px;
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 20px;
  font-size: .95rem; font-weight: 600; color: var(--navy);
  text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  transition: box-shadow .15s, transform .15s;
}
.btn-google:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); transform: translateY(-1px); }
.btn-google-sm { padding: 7px 14px; font-size: .85rem; gap: 7px; }
.btn-google-hero { padding: 15px 28px; font-size: 1.05rem; border-radius: 10px; }

/* NAV USER */
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.nav-name { font-size: .875rem; font-weight: 600; color: var(--navy); }

/* HERO */
.hero {
  background: linear-gradient(160deg, #0F172A 0%, #1E3A8A 60%, #1D4ED8 100%);
  padding: 100px 0 80px; text-align: center;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); color: #BAE6FD;
  border: 1px solid rgba(255,255,255,.2); border-radius: 100px;
  padding: 6px 16px; font-size: .82rem; font-weight: 600;
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 900; color: white;
  line-height: 1.1; letter-spacing: -1.5px; max-width: 700px;
}
.hero-title em { font-style: normal; color: #60A5FA; }
.hero-sub { font-size: 1.15rem; color: #CBD5E1; max-width: 560px; }
.hero-cta { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hero-note { font-size: .83rem; color: #94A3B8; }
.login-error {
  background: rgba(239,68,68,.15); color: #FCA5A5;
  border: 1px solid rgba(239,68,68,.3); border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: .875rem;
}
.hero-stats {
  display: flex; align-items: center; gap: 32px;
  margin-top: 8px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 28px;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat strong { font-size: 1.4rem; color: white; font-weight: 800; }
.stat span { font-size: .78rem; color: #94A3B8; }
.stat-divider { width: 1px; height: 36px; background: rgba(255,255,255,.12); }

/* SECTIONS */
.section { padding: 80px 0; }
.section-gray { background: var(--bg-gray); }
.section-title { font-size: 2rem; font-weight: 800; text-align: center; letter-spacing: -.5px; margin-bottom: 10px; }
.section-sub { text-align: center; color: var(--slate); font-size: 1.05rem; margin-bottom: 48px; }

/* STEPS */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: white;
  font-weight: 800; font-size: 1rem; display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.step h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.step p { font-size: .9rem; color: var(--slate); }

/* LOGIN WALL */
.login-wall { max-width: 900px; margin: 0 auto; }
.login-card {
  background: white; border: 1px solid var(--border); border-radius: 16px;
  padding: 56px 48px; text-align: center;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.login-icon { font-size: 3rem; }
.login-card h3 { font-size: 1.4rem; font-weight: 800; }
.login-card p { color: var(--slate); max-width: 360px; }

/* TOOL */
.tool-card {
  background: white; border: 1px solid var(--border); border-radius: 16px;
  padding: 32px; box-shadow: var(--shadow-lg); max-width: 900px; margin: 0 auto;
}
.tool-top { display: flex; justify-content: flex-end; margin-bottom: 20px; }
.credits-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0;
  border-radius: 100px; padding: 5px 12px; font-size: .8rem; font-weight: 600;
}
.credits-badge.warning { background: #FFFBEB; color: #B45309; border-color: #FDE68A; }
.credits-badge.empty { background: #FFF1F2; color: #BE123C; border-color: #FECDD3; }
.credits-badge.unlimited { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }

.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--navy); }
.req { color: var(--blue); }
.field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: .9rem; font-family: inherit; resize: vertical;
  color: var(--navy); background: var(--bg-gray); line-height: 1.55;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea:focus {
  outline: none; border-color: var(--blue); background: white;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.char-count { font-size: .75rem; color: #94A3B8; text-align: right; }

.tool-options { display: flex; align-items: center; gap: 8px; margin: 20px 0 14px; flex-wrap: wrap; }
.tone-label { font-size: .85rem; font-weight: 600; color: var(--slate); margin-right: 4px; }
.tone-opt { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tone-opt input { accent-color: var(--blue); }
.tone-opt span { font-size: .875rem; }
.extra-field { margin-bottom: 18px; }
.label-opt { font-size: .8rem; color: var(--slate); font-weight: 400; }

.tool-actions { display: flex; flex-direction: column; gap: 10px; }
.tool-error {
  font-size: .875rem; color: #DC2626; background: #FFF1F2;
  border: 1px solid #FECDD3; border-radius: var(--radius-sm); padding: 10px 14px;
}
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* RESULT */
.result-section { margin-top: 28px; border-top: 1px solid var(--border); padding-top: 24px; }
.result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.result-header h3 { font-size: 1rem; font-weight: 700; }
.result-actions { display: flex; gap: 8px; }
.result-body {
  background: var(--bg-gray); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 24px; font-size: .9rem; line-height: 1.75; white-space: pre-wrap; color: var(--navy);
}

/* UPGRADE */
.upgrade-banner {
  max-width: 900px; margin: 24px auto 0;
  background: linear-gradient(135deg, #1E3A8A, #1D4ED8);
  border-radius: var(--radius); padding: 28px 32px;
}
.upgrade-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.upgrade-inner h3 { color: white; font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.upgrade-inner p { color: #BAE6FD; font-size: .9rem; }
.upgrade-inner strong { color: white; }

/* PRICING */
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 700px; margin: 0 auto; }
.pricing-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; position: relative; }
.pricing-card-featured { border: 2px solid var(--blue); box-shadow: var(--shadow-lg); }
.plan-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--blue); color: white; font-size: .75rem; font-weight: 700;
  padding: 4px 14px; border-radius: 100px; white-space: nowrap;
}
.plan-label { font-size: .85rem; color: var(--slate); font-weight: 600; margin-bottom: 8px; }
.plan-price { font-size: 2.5rem; font-weight: 900; letter-spacing: -1px; margin-bottom: 4px; }
.plan-desc { font-size: .8rem; color: var(--slate); margin-bottom: 20px; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.plan-features li { font-size: .9rem; color: #334155; }

/* FOOTER */
.footer { background: var(--navy); padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
.footer .logo { color: white; }
.footer-copy { font-size: .82rem; color: #64748B; }

/* SUCCESS */
.success-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-gray); }
.success-card { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 56px 48px; text-align: center; max-width: 480px; width: 100%; box-shadow: var(--shadow-lg); }
.success-icon { font-size: 3.5rem; margin-bottom: 20px; }
.success-card h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 12px; }
.success-card p { color: var(--slate); margin-bottom: 28px; }

.hidden { display: none !important; }

/* BTC MODAL */
.btc-modal-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(15,23,42,.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.btc-modal {
  background: white; border-radius: 16px; padding: 36px 32px;
  max-width: 440px; width: 100%; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  text-align: center; display: flex; flex-direction: column; gap: 14px;
}
.btc-modal h3 { font-size: 1.3rem; font-weight: 800; }
.btc-modal-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; font-size: 1.4rem; cursor: pointer;
  color: var(--slate); line-height: 1;
}
.btc-modal-sub { color: var(--slate); font-size: .9rem; }
.btc-loading { color: var(--slate); font-size: .9rem; padding: 20px 0; }
.btc-qr { width: 200px; height: 200px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 0 auto; display: block; }
.btc-addr-wrap { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; }
.btc-addr { font-size: .72rem; background: var(--bg-gray); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; word-break: break-all; }
.btc-status-waiting { font-size: .85rem; color: var(--slate); }
.btc-expire-note { font-size: .75rem; color: #94A3B8; }
.btc-confirmed { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.btc-confirmed h4 { font-size: 1.2rem; font-weight: 800; color: #15803D; }

@media (max-width: 720px) {
  .tool-grid, .steps, .pricing-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  .upgrade-inner { flex-direction: column; }
  .tool-card { padding: 20px; }
  .hero { padding: 70px 0 60px; }
  .login-card { padding: 36px 24px; }
}
