/* ═══════════════════════════════════════════════════════════════════════════
   RocketTransfer Web Connect Stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --brand-primary: #2E7CFC;
  --brand-secondary: #609BFD;
  --brand-tertiary: #1D4ED8;
  --brand-gradient: linear-gradient(135deg, #609BFD 0%, #2E7CFC 55%, #1D4ED8 100%);
  --brand-glow: rgba(46, 124, 252, 0.35);

  --bg-main: #070F1C;
  --bg-subtle: #0F1D2E;
  --bg-card: rgba(19, 32, 50, 0.85);
  --bg-glass: rgba(15, 29, 46, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: #192E52;
  --border-hover: rgba(96, 155, 253, 0.5);

  --text-white: #FFFFFF;
  --text-primary: #EFF6FF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-accent: #609BFD;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}

[data-theme="light"] {
  --brand-primary: #2E7CFC;
  --brand-secondary: #2E7CFC;
  --brand-tertiary: #1D4ED8;
  --brand-gradient: linear-gradient(135deg, #609BFD 0%, #2E7CFC 55%, #1D4ED8 100%);
  --brand-glow: rgba(46, 124, 252, 0.2);

  --bg-main: #FFFFFF;
  --bg-subtle: #F8FAFC;
  --bg-card: #F5F8FA;
  --bg-glass: rgba(255, 255, 255, 0.92);

  --border-subtle: #E2E8F0;
  --border-card: #E2E8F0;
  --border-hover: rgba(46, 124, 252, 0.4);

  --text-white: #0F172A;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --text-accent: #2E7CFC;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Background Ambient Orbs */
.bg-glow-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #00C6FF 0%, #0066FF 60%, transparent 80%);
  top: -100px;
  left: 20%;
}

.orb-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #8B5CF6 0%, #0066FF 70%, transparent 80%);
  bottom: -100px;
  right: 15%;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Header */
.navbar {
  position: relative;
  z-index: 10;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(6, 11, 20, 0.6);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-white);
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: var(--brand-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 16px var(--brand-glow);
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-name span {
  color: var(--text-accent);
}

.brand-tag {
  display: inline-block;
  font-size: 0.72rem;
  background: rgba(0, 198, 255, 0.12);
  color: var(--text-accent);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0, 198, 255, 0.25);
  margin-left: 8px;
}

.nav-back-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-back-link:hover {
  color: var(--text-white);
}

/* Main Content */
.main-wrapper {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  padding: 40px 0;
}

.connect-card-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 32px;
  align-items: stretch;
}

.card-glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Left: QR Area */
.qr-box-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.qr-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-pulse-dot.active {
  background: #38BDF8;
  box-shadow: 0 0 10px #38BDF8;
  animation: pulse 1.5s infinite;
}

.status-pulse-dot.connected {
  background: #10B981;
  box-shadow: 0 0 10px #10B981;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-white);
}

/* Radar & QR Canvas */
.qr-radar-wrapper {
  position: relative;
  padding: 16px;
  background: #FFFFFF;
  border-radius: 18px;
  border: 2px solid rgba(0, 198, 255, 0.25);
  box-shadow: 0 12px 30px rgba(0, 102, 255, 0.15);
  overflow: hidden;
  margin-bottom: 20px;
}

.radar-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00C6FF, transparent);
  box-shadow: 0 0 12px #00C6FF;
  animation: scanRadar 3s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes scanRadar {
  0% { top: 0; }
  100% { top: 100%; }
}

.qr-canvas-holder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
}

.qr-canvas-holder img {
  border-radius: 10px;
  display: block;
}

.qr-overlay-success {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 19, 36, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.qr-overlay-success.active {
  opacity: 1;
  pointer-events: auto;
}

.success-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid #10B981;
  color: #10B981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 4px;
}

.success-sub {
  font-size: 0.85rem;
  color: var(--text-accent);
}

.session-id-display {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.session-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.session-code {
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-accent);
  background: rgba(0, 198, 255, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 198, 255, 0.2);
}

.wifi-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.wifi-tip svg {
  color: var(--text-accent);
  flex-shrink: 0;
}

/* Right: Guide Card */
.guide-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.guide-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-white);
  margin-bottom: 8px;
}

.guide-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 28px;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 102, 255, 0.15);
  border: 1px solid rgba(0, 198, 255, 0.3);
  color: var(--text-accent);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-heading {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.step-desc b {
  color: var(--text-accent);
}

/* Manual IP Form */
.manual-ip-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
}

.manual-ip-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.manual-ip-toggle:hover {
  color: var(--text-secondary);
}

.manual-ip-form {
  display: none;
  margin-top: 14px;
}

.manual-ip-form.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

.input-group {
  display: flex;
  gap: 10px;
}

.input-group input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text-white);
  outline: none;
  transition: border-color 0.2s ease;
}

.input-group input:focus {
  border-color: var(--brand-secondary);
}

.btn-connect {
  background: var(--brand-gradient);
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-connect:hover {
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 860px) {
  .connect-card-grid {
    grid-template-columns: 1fr;
  }
}
