/* ===========================
   CONNECTION BJ — STYLE.CSS
   Mobile-First Sales App
   =========================== */

:root {
  --softbank: #0a6abf;
  --softbank-light: #e3f0fa;
  --biglobe: #e85d04;
  --biglobe-light: #fff0e6;
  --au: #9b2226;
  --au-light: #fdecea;
  --nuro: #6a0572;
  --nuro-light: #f5e6f7;
  --flets: #1b4332;
  --flets-light: #e6f4ed;
  --tsunagaru: #1565c0;
  --tsunagaru-light: #e3ecfa;
  --home: #b5451b;
  --home-light: #fdf0eb;

  --primary: #1a237e;
  --primary-dark: #0d1547;
  --accent: #ff6f00;
  --success: #2e7d32;
  --warning: #f57f17;
  --danger: #c62828;
  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f4;
  --gray-200: #e8eaed;
  --gray-300: #dadce0;
  --gray-600: #80868b;
  --gray-800: #3c4043;
  --gray-900: #202124;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --transition: 0.2s ease;

  --topbar-h: 56px;
  --bottomnav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: var(--gray-900);
  background: var(--gray-100);
  overflow: hidden;
}

/* ======================== SPLASH ======================== */
#splash {
  position: fixed; inset: 0;
  background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
#splash.fade-out { opacity: 0; transform: scale(1.05); pointer-events: none; }

.splash-logo { text-align: center; color: var(--white); }
.splash-icon {
  width: 80px; height: 80px; border-radius: 20px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 36px;
}
.splash-logo h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.splash-logo p { font-size: 14px; opacity: 0.7; margin-top: 4px; margin-bottom: 24px; }
.splash-bar { width: 200px; height: 3px; background: rgba(255,255,255,0.2); border-radius: 99px; overflow: hidden; }
.splash-fill { height: 100%; background: white; border-radius: 99px; animation: splashLoad 1.8s ease forwards; }
@keyframes splashLoad { from{width:0} to{width:100%} }

/* ======================== APP ======================== */
#app { height: 100vh; display: flex; flex-direction: column; }
#app.hidden { display: none; }

/* ======================== TOPBAR ======================== */
.topbar {
  height: var(--topbar-h);
  background: var(--primary);
  color: var(--white);
  display: flex; align-items: center;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: relative;
  z-index: 100;
}
.topbar-title {
  flex: 1;
  font-weight: 700;
  font-size: 17px;
  text-align: center;
}
.btn-back, .btn-icon {
  width: 40px; height: 40px;
  border: none; background: rgba(255,255,255,0.15);
  color: white; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.btn-back:active, .btn-icon:active { background: rgba(255,255,255,0.25); }
.btn-back.hidden { opacity: 0; pointer-events: none; }

/* ======================== PAGE CONTAINER ======================== */
#pageContainer {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 8px);
}

/* ======================== BOTTOM NAV ======================== */
.bottomnav {
  height: calc(var(--bottomnav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  border: none; background: none;
  color: var(--gray-600);
  font-size: 10px; font-weight: 500;
  cursor: pointer;
  transition: color var(--transition);
  padding: 8px 4px;
}
.nav-btn i { font-size: 20px; }
.nav-btn.active { color: var(--primary); }
.nav-btn.active i { font-size: 22px; }
.nav-btn:active { opacity: 0.7; }

/* ======================== PAGE TRANSITIONS ======================== */
.page { animation: pageIn 0.25s ease; }
@keyframes pageIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

/* ======================== HOME PAGE ======================== */
.home-hero {
  background: linear-gradient(145deg, var(--primary-dark), var(--primary));
  color: white;
  padding: 24px 16px 32px;
  text-align: center;
}
.home-hero h2 { font-size: 22px; font-weight: 800; }
.home-hero p { font-size: 13px; opacity: 0.8; margin-top: 4px; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 12px 0;
  margin-top: -16px;
}
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card .val { font-size: 15px; font-weight: 800; color: var(--primary); line-height: 1.2; }
.stat-card .lbl { font-size: 10px; color: var(--gray-600); margin-top: 2px; }

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 16px 8px;
}

.operator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 12px 8px;
}
.op-card {
  border-radius: var(--radius);
  padding: 16px 12px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.op-card:active { transform: scale(0.97); }
.op-card::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius);
}
.op-card .op-icon { font-size: 24px; }
.op-card .op-name { font-size: 13px; font-weight: 700; color: white; line-height: 1.2; }
.op-card .op-price { font-size: 11px; color: rgba(255,255,255,0.85); }
.op-card .op-badge {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,0.25);
  color: white; font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 99px;
}
.op-card .op-arrow { color: rgba(255,255,255,0.6); font-size: 12px; align-self: flex-end; }

.op-softbank { background: linear-gradient(135deg, #0a6abf, #0552a0); }
.op-biglobe  { background: linear-gradient(135deg, #e85d04, #c44b00); }
.op-au       { background: linear-gradient(135deg, #9b2226, #7a1a1d); }
.op-nuro     { background: linear-gradient(135deg, #6a0572, #4a0350); }
.op-flets    { background: linear-gradient(135deg, #1b4332, #0d2b20); }
.op-tsunagaru{ background: linear-gradient(135deg, #1565c0, #0d47a1); }
.op-home     { background: linear-gradient(135deg, #b5451b, #8b2f0e); }

.tip-card {
  margin: 0 12px 12px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  padding: 12px;
  display: flex; gap: 10px; align-items: flex-start;
}
.tip-card i { color: #f57f17; font-size: 18px; margin-top: 1px; }
.tip-card p { font-size: 12px; color: #5a3a00; line-height: 1.5; }

/* ======================== OPERATOR DETAIL PAGE ======================== */
.op-header {
  padding: 20px 16px;
  color: white;
  display: flex; flex-direction: column; gap: 6px;
}
.op-header .badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
.op-header .badge {
  background: rgba(255,255,255,0.2);
  color: white; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 99px;
}
.op-header h2 { font-size: 24px; font-weight: 800; }
.op-header .sub { font-size: 13px; opacity: 0.8; }

.section-card {
  margin: 12px 12px 0;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.section-card-header {
  padding: 12px 16px;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--gray-100);
}
.section-card-header i { font-size: 16px; }
.section-card-body { padding: 12px 16px; }

/* Info rows */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 12px; color: var(--gray-600); flex-shrink: 0; max-width: 45%; }
.info-value { font-size: 13px; font-weight: 600; text-align: right; }
.info-value.price { font-size: 15px; color: var(--primary); }
.info-value.danger { color: var(--danger); }
.info-value.success { color: var(--success); }

/* Plan cards */
.plan-cards { display: flex; flex-direction: column; gap: 8px; }
.plan-card {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px;
  position: relative;
}
.plan-card.featured { border-color: var(--accent); }
.plan-card.featured::after {
  content: '⭐ DESTAQUE';
  position: absolute; top: -1px; right: 10px;
  background: var(--accent); color: white;
  font-size: 9px; font-weight: 800;
  padding: 2px 8px; border-radius: 0 0 6px 6px;
}
.plan-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.plan-type { font-size: 13px; font-weight: 700; }
.plan-price { font-size: 18px; font-weight: 800; color: var(--primary); }
.plan-price span { font-size: 12px; font-weight: 500; color: var(--gray-600); }
.plan-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.plan-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 99px;
  font-weight: 600;
}
.tag-green  { background: #e6f4ea; color: #1e7e34; }
.tag-red    { background: #fdecea; color: #c62828; }
.tag-blue   { background: #e3f0fa; color: #0a6abf; }
.tag-orange { background: #fff3e0; color: #e65100; }
.tag-purple { background: #f5e6f7; color: #6a0572; }
.tag-gray   { background: #f1f3f4; color: #5f6368; }

/* Alert */
.alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px; line-height: 1.5;
  display: flex; gap: 8px; align-items: flex-start;
  margin-bottom: 8px;
}
.alert:last-child { margin-bottom: 0; }
.alert i { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.alert-danger  { background: #fdecea; color: #7f0000; }
.alert-warning { background: #fff8e1; color: #5a3a00; }
.alert-success { background: #e6f4ea; color: #0d4d0d; }
.alert-info    { background: #e3f0fa; color: #093d6b; }

/* Promo / benefit cards */
.benefit-cards { display: flex; flex-direction: column; gap: 8px; }
.benefit-card {
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex; gap: 10px;
}
.benefit-card i { font-size: 22px; flex-shrink: 0; }
.benefit-card .b-title { font-size: 13px; font-weight: 700; }
.benefit-card .b-val { font-size: 18px; font-weight: 800; color: var(--primary); margin: 2px 0; }
.benefit-card .b-cond { font-size: 11px; color: var(--gray-600); }

.benefit-cashback { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); }
.benefit-cashback i { color: #2e7d32; }
.benefit-multa { background: linear-gradient(135deg, #fff8e1, #fff0b2); }
.benefit-multa i { color: #f57f17; }
.benefit-phone { background: linear-gradient(135deg, #e3f0fa, #bbdefb); }
.benefit-phone i { color: #1565c0; }
.benefit-install { background: linear-gradient(135deg, #f5e6f7, #e1bee7); }
.benefit-install i { color: #6a0572; }

/* Installation table */
.install-table { width: 100%; }
.install-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 8px;
}
.install-row:last-child { border-bottom: none; }
.install-label { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.install-value { font-size: 13px; font-weight: 700; text-align: right; }

/* Cancel table */
.cancel-table { width: 100%; }
.cancel-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}
.cancel-row:last-child { border-bottom: none; }
.cancel-who { font-size: 11px; color: var(--gray-600); }
.cancel-what { font-size: 13px; font-weight: 600; margin: 2px 0; }
.cancel-val { font-size: 15px; font-weight: 800; color: var(--danger); }

/* ======================== WIZARD PAGE ======================== */
.wizard-wrap { padding: 16px; }
.wizard-header { text-align: center; margin-bottom: 20px; }
.wizard-header h2 { font-size: 20px; font-weight: 800; }
.wizard-header p { font-size: 13px; color: var(--gray-600); margin-top: 4px; }

.wizard-progress { display: flex; gap: 4px; margin-bottom: 20px; }
.wiz-step {
  flex: 1; height: 4px; border-radius: 99px;
  background: var(--gray-200);
  transition: background 0.3s ease;
}
.wiz-step.done { background: var(--primary); }
.wiz-step.active { background: var(--accent); }

.wizard-q { font-size: 17px; font-weight: 700; margin-bottom: 16px; line-height: 1.4; }
.wizard-options { display: flex; flex-direction: column; gap: 10px; }
.wizard-btn {
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: white; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; font-weight: 600;
  transition: all var(--transition);
}
.wizard-btn i { font-size: 24px; color: var(--primary); width: 28px; text-align: center; }
.wizard-btn .wbtn-sub { font-size: 11px; color: var(--gray-600); font-weight: 400; }
.wizard-btn:active, .wizard-btn.selected {
  border-color: var(--primary); background: var(--primary);
  color: white;
}
.wizard-btn.selected i { color: white; }
.wizard-btn.selected .wbtn-sub { color: rgba(255,255,255,0.7); }

/* Result */
.wizard-result h3 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.wizard-result p { font-size: 13px; color: var(--gray-600); margin-bottom: 16px; }
.result-list { display: flex; flex-direction: column; gap: 10px; }
.result-card {
  border-radius: var(--radius);
  padding: 14px;
  color: white;
  cursor: pointer;
  transition: transform var(--transition);
  display: flex; justify-content: space-between; align-items: center;
}
.result-card:active { transform: scale(0.97); }
.result-card .rc-left { display: flex; flex-direction: column; gap: 4px; }
.result-card .rc-rank { font-size: 18px; }
.result-card .rc-name { font-size: 16px; font-weight: 800; }
.result-card .rc-price { font-size: 13px; opacity: 0.85; }
.result-card .rc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.result-card .rc-tag {
  background: rgba(255,255,255,0.2); color: white;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px;
}
.result-card .rc-arrow { font-size: 22px; opacity: 0.7; }

.wizard-restart-btn {
  width: 100%; margin-top: 16px; padding: 14px;
  border: 2px solid var(--gray-300); border-radius: var(--radius);
  background: white; font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--gray-800);
}

/* ======================== COMPARE PAGE ======================== */
.compare-wrap { padding: 12px; }
.compare-filter {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.filter-btn {
  padding: 6px 14px; border-radius: 99px;
  border: 1.5px solid var(--gray-300);
  background: white; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.compare-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px; white-space: nowrap;
  background: white; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.compare-table th {
  padding: 10px 12px; text-align: left;
  font-size: 11px; font-weight: 700;
  background: var(--primary); color: white;
}
.compare-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:nth-child(even) td { background: var(--gray-50); }
.c-badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 99px;
  font-size: 10px; font-weight: 700; white-space: nowrap;
}
.c-best { background: #e6f4ea; color: #1e7e34; }
.c-ok   { background: #e3f0fa; color: #0a6abf; }
.c-no   { background: #fdecea; color: #c62828; }
.c-warn { background: #fff8e1; color: #e65100; }
.c-special { background: #f5e6f7; color: #6a0572; }

.op-color-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; margin-right: 4px; vertical-align: middle; flex-shrink: 0;
}

/* ======================== SCRIPTS PAGE ======================== */
.scripts-wrap { padding: 12px; }
.scripts-cat { margin-bottom: 16px; }
.scripts-cat-title {
  font-size: 12px; font-weight: 700; color: var(--gray-600);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 0 10px;
}
.script-card {
  background: white; border-radius: var(--radius);
  margin-bottom: 8px; box-shadow: var(--shadow);
  overflow: hidden;
}
.script-card-title {
  padding: 10px 14px;
  font-size: 13px; font-weight: 700;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  display: flex; justify-content: space-between; align-items: center;
}
.script-text {
  padding: 10px 14px;
  font-size: 12px; line-height: 1.7;
  color: var(--gray-800); white-space: pre-line;
}
.copy-btn {
  padding: 5px 12px; border-radius: 99px;
  border: none; background: var(--primary); color: white;
  font-size: 11px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  transition: background var(--transition);
  flex-shrink: 0;
}
.copy-btn.copied { background: var(--success); }
.copy-btn i { font-size: 12px; }

/* ======================== CONTACT PAGE ======================== */
.contact-wrap { padding: 12px; }
.contact-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius);
  padding: 20px;
  color: white;
  text-align: center;
  margin-bottom: 12px;
}
.contact-header h2 { font-size: 20px; font-weight: 800; }
.contact-header p { font-size: 12px; opacity: 0.8; margin-top: 4px; }
.contact-links { display: flex; flex-direction: column; gap: 10px; }
.contact-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  border-radius: var(--radius);
  text-decoration: none; color: white;
  font-weight: 700; font-size: 14px;
  transition: opacity var(--transition);
  box-shadow: var(--shadow);
}
.contact-btn:active { opacity: 0.85; }
.contact-btn i { font-size: 24px; width: 28px; text-align: center; flex-shrink: 0; }
.contact-btn .cb-sub { font-size: 12px; font-weight: 400; opacity: 0.85; }
.btn-wa   { background: #25d366; }
.btn-tel  { background: #0a6abf; }
.btn-mail { background: #ea4335; }
.btn-site { background: #1a237e; }

.hours-card {
  background: white; border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
  margin-top: 12px;
}
.hours-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.hours-row {
  display: flex; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.hours-row:last-child { border-bottom: none; }

/* ======================== REGIONS PAGE ======================== */
.region-block {
  margin: 12px 12px 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.region-header {
  padding: 14px 16px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.region-title {
  display: flex; align-items: center; gap: 10px;
}
.region-ops-badge {
  background: rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.pref-list {
  background: white;
  display: flex;
  flex-direction: column;
}
.pref-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}
.pref-item:last-child { border-bottom: none; }
.pref-num {
  font-size: 10px;
  color: var(--gray-600);
  width: 18px;
  flex-shrink: 0;
  text-align: right;
}
.pref-name {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
}
.pref-ja {
  font-size: 12px;
  color: var(--gray-600);
  flex-shrink: 0;
}

/* ======================== UTILITIES ======================== */
.hidden { display: none !important; }
.px-12 { padding: 0 12px; }
.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }
.text-center { text-align: center; }

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--gray-600);
}
.empty-state i { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ======================== SCROLLBAR ======================== */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }

/* ======================== RESPONSIVE ======================== */
@media (min-width: 480px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .operator-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  #app { max-width: 480px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,0.2); }
  html, body { background: #e0e0e0; }
}
