/* ==========================================================================
   BHARATAQI - SENSOR MODULE CONFIGURATION & PROVISIONING STYLESHEET
   100% Self-Contained, Native System Fonts, Cyber-Secured Styling
   ========================================================================== */

/* ---------------- TABS & SECTIONS ---------------- */
.cfg-section {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 26px;
  margin-bottom: 24px;
  animation: fadeIn 0.25s ease-out;
}

.cfg-section.active {
  display: block;
}

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

.cfg-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.cfg-section-head h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.3px;
}

.cfg-section-head p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------------- FORMS & INPUTS ---------------- */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.col-span-2 {
  grid-column: span 2;
}

label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  background: rgba(15, 23, 42, 0.95);
}

.field-hint {
  font-size: 0.73rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ---------------- SWITCHES & TOGGLES ---------------- */
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
}

.switch-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-white);
  text-transform: none;
  cursor: pointer;
}

.form-switch {
  width: 44px;
  height: 24px;
  appearance: none;
  background: #334155;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.form-switch:checked {
  background: var(--accent-cyan);
}

.form-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.form-switch:checked::after {
  transform: translateX(20px);
}

/* ---------------- PROTOCOL CARDS ---------------- */
.protocol-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 20px;
  transition: border-color 0.2s ease;
}

.protocol-card:hover {
  border-color: var(--border-hover);
}

.protocol-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.proto-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.proto-info h4 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-white);
}

.proto-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* ---------------- WI-FI SCANNER ---------------- */
.wifi-scanner-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.wsb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.wsb-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-white);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wsb-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.wifi-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.wifi-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s ease;
}

.wifi-item:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--accent-cyan);
  transform: translateX(3px);
}

.wifi-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wifi-icon { font-size: 1.1rem; }
.wifi-name { font-size: 0.92rem; font-weight: 700; color: var(--text-white); }
.wifi-sec { font-size: 0.72rem; color: var(--text-dim); margin-top: 1px; }

.wifi-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wifi-signal-pill {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--cpcb-good);
  background: rgba(34, 197, 94, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
}

.wifi-placeholder {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---------------- PASSWORD EYE BUTTON ---------------- */
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  padding-right: 42px;
  width: 100%;
}

.btn-toggle-eye {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  color: var(--text-muted);
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.btn-toggle-eye:hover {
  opacity: 1;
}

/* ---------------- METRIC STRIP ---------------- */
.info-metric-strip {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
}

.ims-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ims-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
}

.ims-value {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-weight: 800;
  font-family: var(--font-mono);
}

/* ---------------- ACTION FOOTER ---------------- */
.cfg-action-footer {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.caf-left {
  display: flex;
  gap: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.76rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-white);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------------- LOGIN MODAL OVERLAY ---------------- */
.login-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-modal-overlay.hidden {
  display: none !important;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 34px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.login-header {
  text-align: center;
  margin-bottom: 22px;
}

.login-shield-icon {
  font-size: 2.8rem;
  display: block;
  margin-bottom: 10px;
}

.login-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-white);
}

.login-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.45;
}

.login-alert-tip {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-xs);
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 0.78rem;
  color: #bae6fd;
}

.login-alert-tip code {
  background: rgba(15, 23, 42, 0.8);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: #ffffff;
  font-weight: 700;
}

.login-error-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  margin-bottom: 18px;
  text-align: center;
  font-weight: 600;
}

.btn-block {
  width: 100%;
}

.login-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

/* ---------------- USER PROFILE BADGE ---------------- */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.user-avatar { font-size: 1.2rem; }
.upb-info { flex: 1; display: flex; flex-direction: column; }
.upb-name { font-size: 0.82rem; font-weight: 700; color: var(--text-white); }
.upb-role { font-size: 0.68rem; color: var(--accent-cyan); font-weight: 600; }

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  transition: color 0.2s ease;
}

.btn-logout:hover {
  color: #ef4444;
}

/* ---------------- TOAST NOTIFICATION ---------------- */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  border: 1px solid var(--accent-cyan);
  color: var(--text-white);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.88rem;
  font-weight: 700;
  z-index: 2000;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.3s ease;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.module-status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #4ade80;
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

@media (max-width: 900px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .cfg-action-footer { flex-direction: column; gap: 14px; }
  .caf-left, .caf-right { width: 100%; justify-content: center; }
  .caf-right button { width: 100%; }
}
