/* ═══════════════════════════════════════════
   INSTALL & WEB FLASHER PAGE STYLES — SolarVisionX
   Aesthetic: Airy Precision / Glowing Card System
═══════════════════════════════════════════ */

.install-main {
  position: relative;
  overflow: hidden;
  padding-top: calc(var(--nav-h) + var(--sp-8));
  padding-bottom: var(--sp-16);
}

.install-bg-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 50% 15%, var(--brand-glow) 0%, transparent 60%),
    radial-gradient(circle at 85% 60%, rgba(34, 163, 85, 0.08) 0%, transparent 50%),
    linear-gradient(rgba(15, 23, 42, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
}

/* ── Hero ── */
.install-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: var(--sp-10);
}

.install-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.35rem 0.9rem;
  background: var(--brand-xlight);
  border: 1px solid var(--brand-light);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-4);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.install-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: var(--sp-3);
}

.gradient-text {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.install-hero__subtitle {
  font-size: 1.05rem;
  color: var(--ink-500);
  max-width: 680px;
  margin: 0 auto var(--sp-8);
  line-height: 1.6;
}

/* ── Web Flasher Card (Main Attraction) ── */
.web-flasher-card {
  max-width: 840px;
  margin: 0 auto;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid var(--brand-light);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  box-shadow: 0 25px 50px -15px var(--brand-glow), var(--shadow-lg);
  text-align: left;
  position: relative;
  overflow: hidden;
}

@media (min-width: 640px) {
  .web-flasher-card {
    padding: var(--sp-8) var(--sp-10);
  }
}

.flasher-glow-aura {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, var(--brand-glow) 0%, transparent 70%);
  pointer-events: none;
}

.flasher-header {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.flasher-chip-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--brand-xlight);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--brand-glow-sm);
}

.flasher-title-group {
  flex: 1;
  min-width: 220px;
}

.flasher-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.flasher-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0.15rem 0 0 0;
}

.flasher-ver-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  color: var(--ink-500);
}

.flasher-ver-pill strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--brand-dark);
}

/* ── 3-Step Visual Bar ── */
.flasher-steps-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin: var(--sp-6) 0;
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  flex-wrap: wrap;
}

.fstep {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fstep-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fstep-txt {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-700);
}

.fstep-sep {
  color: var(--brand-light);
  font-weight: bold;
}

@media (max-width: 640px) {
  .fstep-sep {
    display: none;
  }
}

/* ── Action Box & Flash Button ── */
.flasher-action-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  padding-top: var(--sp-2);
  text-align: center;
}

.browser-status {
  width: 100%;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

.status-chip.supported {
  background: var(--brand-xlight);
  border: 1px solid var(--brand-light);
  color: var(--brand-dark);
}

.status-chip.unsupported {
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
}

.esp-install-wrapper {
  margin: var(--sp-2) 0;
  display: flex;
  justify-content: center;
}

/* Styled Activate Button for ESP Web Tools */
.btn-flash-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, var(--brand) 0%, #15803D 100%);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  padding: 1rem 2.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--brand-glow), 0 2px 6px rgba(0,0,0,0.1);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-flash-primary:hover {
  background: linear-gradient(135deg, var(--brand-dark) 0%, #14532D 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px var(--brand-glow);
}

.btn-flash-primary:active {
  transform: translateY(0);
}

.unsupported-msg,
.not-allowed-msg {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  color: #991B1B;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  max-width: 580px;
}

.flasher-hint {
  font-size: 0.85rem;
  color: var(--ink-500);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

/* ── Section Title Wrap ── */
.section-title-wrap {
  text-align: center;
  margin-bottom: var(--sp-8);
}

.section-sub-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.35rem 0;
}

.section-sub-desc {
  font-size: 0.95rem;
  color: var(--ink-500);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Methods Tabs ── */
.install-methods-section {
  position: relative;
  z-index: 1;
  margin-bottom: var(--sp-12);
  padding-top: var(--sp-8);
}

.methods-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

@media (min-width: 768px) {
  .methods-nav {
    grid-template-columns: 1fr 1fr;
  }
}

.method-tab {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  text-align: left;
  position: relative;
  transition: all 0.2s ease;
}

.method-tab:hover {
  border-color: var(--brand-light);
  background: var(--bg-card-hover);
}

.method-tab.active {
  border-color: var(--brand);
  background: white;
  box-shadow: 0 10px 25px -5px var(--brand-glow), var(--shadow-sm);
}

.tab-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--brand-xlight);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tab-text {
  display: flex;
  flex-direction: column;
}

.tab-text strong {
  font-size: 1rem;
  color: var(--ink);
}

.tab-text small {
  font-size: 0.82rem;
  color: var(--ink-500);
}

.method-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.method-pill.recommended {
  background: var(--brand-xlight);
  color: var(--brand);
  border: 1px solid var(--brand-light);
}

/* ── Guide Box Content ── */
.guide-box {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-md);
}

@media (min-width: 640px) {
  .guide-box {
    padding: var(--sp-10);
  }
}

.guide-box__header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  padding-bottom: var(--sp-6);
}

.guide-badge-num {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--brand-xlight);
  color: var(--brand);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.25rem 0;
}

.guide-desc {
  font-size: 0.95rem;
  color: var(--ink-500);
  margin: 0;
  line-height: 1.55;
}

/* ── OTA Flowchart ── */
.ota-flow-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  background: rgba(25, 122, 64, 0.03);
  border: 1px dashed var(--brand-light);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-8);
}

.ota-flow-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 180px;
}

.flow-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flow-content h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 2px 0;
}

.flow-content p {
  font-size: 0.78rem;
  color: var(--ink-500);
  margin: 0;
  line-height: 1.35;
}

.flow-arrow {
  color: var(--brand-mid);
  font-size: 1.25rem;
  font-weight: bold;
}

@media (max-width: 768px) {
  .flow-arrow {
    display: none;
  }
}

/* ── Steps Timeline ── */
.steps-heading {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: var(--sp-6) 0 var(--sp-4) 0;
}

.steps-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.step-card {
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

@media (min-width: 640px) {
  .step-card {
    flex-direction: row;
    gap: var(--sp-5);
  }
}

.step-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-xlight);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  align-self: flex-start;
  white-space: nowrap;
}

.step-body h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.25rem 0;
}

.step-body p {
  font-size: 0.9rem;
  color: var(--ink-500);
  margin: 0;
  line-height: 1.5;
}

.code-banner {
  background: #0F172A;
  color: #38BDF8;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: 0.5rem 0;
}

.step-subtext {
  font-size: 0.82rem !important;
  color: var(--ink-muted) !important;
}

/* ── Version Checker ── */
.version-checker-card {
  background: white;
  border: 1px solid var(--brand-light);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: 0 4px 20px var(--brand-glow-sm);
}

.checker-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.checker-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.checker-subtitle {
  font-size: 0.85rem;
  color: var(--ink-500);
  margin: 0;
}

.checker-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

@media (min-width: 640px) {
  .checker-form {
    flex-direction: row;
    align-items: flex-end;
  }
}

.input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.input-wrap label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-700);
}

.input-wrap input {
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.input-wrap input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.btn-check-version {
  background: var(--brand);
  color: white;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.72rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.btn-check-version:hover {
  background: var(--brand-dark);
}

.checker-result {
  margin-top: var(--sp-4);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.45;
  animation: fadeIn 0.3s ease;
}

.checker-result.update-needed {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  color: #92400E;
}

.checker-result.up-to-date {
  background: var(--brand-xlight);
  border: 1px solid var(--brand-light);
  color: var(--brand-dark);
}

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

/* ── Tab 2: Requirements Grid ── */
.requirements-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

@media (min-width: 768px) {
  .requirements-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.req-card {
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
}

.req-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--brand-xlight);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-3);
}

.req-card h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.35rem 0;
}

.req-card p {
  font-size: 0.85rem;
  color: var(--ink-500);
  margin: 0 0 var(--sp-4) 0;
  flex: 1;
}

.req-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}

.req-link:hover {
  text-decoration: underline;
}

/* ── Config Table ── */
.config-table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--sp-8);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  background: white;
}

.config-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.config-table th {
  background: #F8FAFC;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--ink-700);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.config-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  color: var(--ink-500);
}

.config-table code {
  font-family: var(--font-mono);
  background: rgba(15, 23, 42, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--brand-dark);
  font-weight: 600;
}

/* ── Terminal Card ── */
.terminal-card {
  background: #0F172A;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: var(--sp-8);
}

.terminal-card__header {
  background: #1E293B;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.term-dot.red { background: #EF4444; }
.term-dot.yellow { background: #F59E0B; }
.term-dot.green { background: #10B981; }

.term-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #94A3B8;
  margin-left: 8px;
  flex: 1;
}

.copy-term-btn {
  color: #94A3B8;
}

.copy-term-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.terminal-code {
  padding: 1.25rem 1rem;
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #E2E8F0;
}

.cmd-comment {
  color: #64748B;
}

/* ── FAQ ── */
.faq-section {
  position: relative;
  z-index: 1;
  margin-bottom: var(--sp-12);
}

.faq-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  margin-bottom: var(--sp-8);
}

.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.faq-item {
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-item[open] {
  border-color: var(--brand-light);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-arrow {
  color: var(--ink-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-item[open] .faq-arrow {
  transform: rotate(180deg);
  color: var(--brand);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9rem;
  color: var(--ink-500);
  line-height: 1.6;
}

.faq-answer p {
  margin: 0;
}
