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

:root {
  --bg:          #111318;
  --bg-card:     #1a1d24;
  --bg-input:    #13161c;
  --border:      #2a2d36;
  --border-hover:#3a3d4a;

  --teal:        #2a7a6e;
  --teal-hover:  #246860;
  --teal-light:  #3ab5a5;

  --text-1: #e8eaf0;
  --text-2: #8a8fa8;
  --text-3: #585c72;

  --success-bg: #0f2a24;
  --success-border: #1e5044;
  --success-text: #4ecca3;

  --error-bg: #2a1010;
  --error-border: #5a2020;
  --error-text: #f07070;

  --radius: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
}

/* Constrain all images by default */
img { max-width: 100%; height: auto; display: block; }

/* ─── Shared page wrappers ─── */
.app-wrapper {
  max-width: 620px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.landing-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.support-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ─── Header ─── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.logo-link { text-decoration: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text-1); background: rgba(255,255,255,0.05); }
.nav-link--active { color: var(--text-1); font-weight: 600; background: rgba(255,255,255,0.06); }

.logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.site-subtitle {
  font-size: 0.78rem;
  color: var(--text-3);
  font-weight: 400;
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--success-border);
  color: var(--success-text);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--success-bg);
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.support-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.support-link:hover { color: var(--text-1); border-color: var(--border-hover); }

/* ─── Main Card (backup recovery) ─── */
.main-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: none;
}

/* ─── Step Sections ─── */
.step-section { padding: 28px 30px; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 30px;
}

.step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 16px;
  cursor: default;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--teal);
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.step-help {
  font-size: 0.84rem;
  color: var(--text-2);
  margin-bottom: 18px;
  line-height: 1.55;
}
.step-help strong { color: var(--text-1); font-weight: 600; }

/* ─── Drop Zone ─── */
.drop-zone {
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--bg-input);
  outline: none;
}
.drop-zone:hover, .drop-zone:focus, .drop-zone.drag-over {
  border-color: var(--teal-light);
  background: #13201e;
  border-style: solid;
}
.drop-zone.has-file {
  border-color: var(--success-border);
  border-style: solid;
  background: var(--success-bg);
}

.drop-icon {
  color: var(--text-3);
  margin-bottom: 12px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.drop-title { font-size: 0.95rem; font-weight: 500; color: var(--text-1); margin-bottom: 5px; }
.drop-title code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--teal-light);
  background: rgba(42,122,110,0.15);
  padding: 1px 6px;
  border-radius: 4px;
}
.drop-hint { font-size: 0.82rem; color: var(--text-3); }
.drop-link { color: var(--teal-light); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

#file-chosen {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  font-family: var(--mono);
  color: var(--success-text);
}
#file-chosen[hidden] {
  display: none !important;
}

.clear-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 0 4px;
  font-size: 0.85rem;
  transition: color 0.15s;
  margin-left: 2px;
}
.clear-btn:hover { color: var(--error-text); }

/* ─── Password ─── */
.password-field-wrap { display: flex; align-items: center; position: relative; }

.password-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 12px 48px 12px 14px;
  outline: none;
  transition: border-color 0.15s;
  letter-spacing: 0.04em;
}
.password-input::placeholder { font-family: var(--font); color: var(--text-3); letter-spacing: 0; }
.password-input:focus { border-color: var(--teal); }

.toggle-pw-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.toggle-pw-btn:hover { color: var(--text-2); }

/* ─── Progress ─── */
.progress-wrap { margin-bottom: 18px; }
.progress-track { background: var(--border); border-radius: 4px; height: 4px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: var(--teal-light); border-radius: 4px; width: 0%; transition: width 0.35s ease; }
.progress-label { font-size: 0.78rem; color: var(--text-2); }

/* ─── Error / Success boxes ─── */
.error-box, .success-box {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 16px;
}
.error-box[hidden], .success-box[hidden] { display: none; }
.error-box { background: var(--error-bg); border: 1px solid var(--error-border); color: var(--error-text); }
.success-box { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-text); }
.error-box svg, .success-box svg { flex-shrink: 0; margin-top: 2px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  user-select: none;
}

.btn-primary { background: var(--teal); color: #fff; width: 100%; justify-content: center; }
.btn-primary:hover:not(:disabled) { background: var(--teal-hover); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary.loading { pointer-events: none; opacity: 0.7; }
.btn-primary.loading .btn-icon { display: none; }
.btn-primary.loading .btn-text { margin-left: 8px; }
.btn-primary.loading::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Vault summary ─── */
#vault-summary-wrap { margin-top: 24px; }

.vault-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-icon { font-size: 1rem; margin-bottom: 6px; }
.stat-label { font-size: 0.68rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-bottom: 4px; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--teal-light); line-height: 1; }

.download-row { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-download {
  flex: 1 1 auto;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-size: 0.85rem;
}
.btn-download:hover:not(:disabled) { border-color: var(--teal); color: var(--teal-light); }
.btn-download:disabled { opacity: 0.35; cursor: not-allowed; }

/* ─── Footer ─── */
.site-footer { text-align: center; color: var(--text-3); font-size: 0.75rem; line-height: 1.8; }
.site-footer a { color: var(--text-3); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--text-2); }

/* ════════════════════════════════════════
   LANDING PAGE (index.html)
════════════════════════════════════════ */

.hero {
  text-align: center;
  padding: 60px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.hero-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 18px;
  margin: 0 auto 24px;
  display: block;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 14px;
}
.hero-title span { color: var(--teal-light); }

.hero-sub {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 500px;
  margin: 0 auto 32px;
}

.hero-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

.btn-playstore {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 24px;
  background: var(--teal);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
}
.btn-playstore:hover { background: var(--teal-hover); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 24px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-light); }

/* Cert badges */
.cert-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 48px;
}

.cert-badge {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.cert-badge-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.cert-badge-main { font-weight: 600; color: var(--text-1); font-size: 0.83rem; margin-bottom: 3px; }
.cert-badge-sub { font-size: 0.72rem; color: var(--text-3); line-height: 1.4; }
.cert-badge--green { border-color: var(--success-border); background: var(--success-bg); }
.cert-badge--green .cert-badge-main { color: var(--success-text); }

/* Section heading */
.section-heading {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}

/* Pillars */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 48px; }

.pillar { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 20px 18px; }
.pillar-icon { font-size: 1.3rem; margin-bottom: 9px; }
.pillar-title { font-size: 0.88rem; font-weight: 600; color: var(--text-1); margin-bottom: 5px; }
.pillar-desc { font-size: 0.78rem; color: var(--text-2); line-height: 1.55; }

/* Feature list */
.feature-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 48px;
}

.feature-row { display: flex; align-items: flex-start; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.feature-row:last-child { border-bottom: none; }
.feature-row-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; width: 24px; text-align: center; }
.feature-row-title { font-size: 0.88rem; font-weight: 600; color: var(--text-1); margin-bottom: 3px; }
.feature-row-desc { font-size: 0.8rem; color: var(--text-2); line-height: 1.55; }

/* Tech specs grid */
.security-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 48px; }

.sec-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.sec-item-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); margin-bottom: 5px; }
.sec-item-value { font-family: var(--mono); color: var(--teal-light); font-size: 0.78rem; }

/* Bottom CTA */
.bottom-cta {
  text-align: center;
  padding: 36px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 48px;
}
.bottom-cta h2 { font-size: 1.2rem; font-weight: 700; color: var(--text-1); margin-bottom: 10px; }
.bottom-cta p { font-size: 0.85rem; color: var(--text-2); margin-bottom: 24px; line-height: 1.6; }
.bottom-cta-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

/* ════════════════════════════════════════
   SUPPORT PAGE (support.html)
════════════════════════════════════════ */

.donate-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.donate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.donate-card-title { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }

.qr-img { width: 200px; height: 200px; object-fit: contain; border-radius: 8px; display: block; }

.upi-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 13px;
  width: 100%;
  justify-content: space-between;
}
.upi-id-text { font-family: var(--mono); font-size: 0.82rem; color: var(--text-1); letter-spacing: 0.02em; }

.copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-2);
  cursor: pointer;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-family: var(--font);
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.copy-btn:hover { border-color: var(--teal); color: var(--teal-light); }
.copy-btn.copied { border-color: var(--success-border); color: var(--success-text); }

.upi-open-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--teal);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  margin-top: auto;
}
.upi-open-btn:hover { background: var(--teal-hover); }

.razorpay-logo { font-size: 2.2rem; line-height: 1; }

.razorpay-desc { font-size: 0.83rem; color: var(--text-2); line-height: 1.55; }

.razorpay-link {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  background: #2563eb;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
  margin-top: auto;
}
.razorpay-link:hover { background: #1d4ed8; }

.app-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 30px; }

.app-section-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }

.app-logo-sm { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; flex-shrink: 0; }

.app-name { font-size: 1.1rem; font-weight: 700; color: var(--text-1); }
.app-tagline { font-size: 0.8rem; color: var(--text-3); }

.app-pitch { font-size: 0.9rem; color: var(--text-2); line-height: 1.7; margin-bottom: 20px; }
.app-pitch--last { margin-bottom: 0; }
.spacer-flex { flex: 1; }

.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.feature-item { display: flex; align-items: flex-start; gap: 9px; font-size: 0.82rem; color: var(--text-2); line-height: 1.45; }
.feature-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.feature-text strong { display: block; color: var(--text-1); font-weight: 600; font-size: 0.83rem; }

.divider-light { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.free-note {
  font-size: 0.8rem;
  color: var(--text-3);
  text-align: center;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  line-height: 1.6;
}

.intro-text { font-size: 0.9rem; color: var(--text-2); margin-bottom: 18px; line-height: 1.6; }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */

/* Landing: 4-col specs → 2-col */
@media (max-width: 720px) {
  .security-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet / large phone */
@media (max-width: 640px) {
  .landing-wrapper { padding: 20px 14px 60px; }
  .support-wrapper { padding: 20px 14px 60px; }
  .app-wrapper { padding: 20px 14px 48px; gap: 16px; }

  .hero { padding: 36px 0 28px; }
  .hero-title { font-size: 1.55rem; }
  .hero-sub { font-size: 0.9rem; }
  .btn-playstore, .btn-ghost { font-size: 0.88rem; padding: 11px 18px; }

  /* Badges: 1 column */
  .cert-row { grid-template-columns: 1fr; }

  /* Pillars: 2 columns */
  .pillars { grid-template-columns: 1fr 1fr; gap: 10px; }
  .security-grid { grid-template-columns: 1fr 1fr; }
  .bottom-cta { padding: 24px 16px; }

  /* Support */
  .donate-row { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .qr-img { width: 160px; height: 160px; }

  /* Backup recovery */
  .step-section { padding: 20px 16px; }
  .divider { margin: 0 16px; }
  .vault-summary { grid-template-columns: repeat(2, 1fr); }
  .download-row { flex-direction: column; }

  /* Nav: shrink */
  .nav-link { font-size: 0.75rem; padding: 5px 9px; }
  .site-title { font-size: 1.05rem; }
  .logo-img { width: 40px; height: 40px; }
}

/* Small phones */
@media (max-width: 420px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .site-nav { width: 100%; justify-content: flex-start; }
  .hero-title { font-size: 1.35rem; }
  .pillars { grid-template-columns: 1fr; }
}
