/* ============================================================
   APC — Premium Account Panel Component System
   All new apc-* classes for the fully redesigned Account tab
   ============================================================ */

/* ── Card variants ── */
.apc-identity { position: relative; overflow: visible; }
.apc-editor   { overflow: hidden; display: flex; flex-direction: column; }
.apc-devices  {}

/* ── Card header row ── */
.apc-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 16px !important;
}

/* ── Eyebrow label with icon ── */
.apc-eyebrow {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  color: #3b82f6 !important;
}

/* ── Identity Hero (avatar + name) ── */
.apc-identity-hero {
  display: flex !important;
  align-items: center !important;
  gap: 18px !important;
  padding: 16px 0 !important;
  border-top: 1px solid rgba(255,255,255,0.05) !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  margin-bottom: 0 !important;
}

/* Override the old profile-preview-row styles inside identity card */
.apc-identity .profile-preview-row {
  display: none !important;
}

.apc-identity-copy {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  min-width: 0 !important;
}

.apc-identity-copy strong {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #fff !important;
  font-family: 'Space Grotesk', sans-serif !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.2 !important;
}

.apc-meta-email {
  font-size: 13px !important;
  color: rgba(226, 236, 255, 0.5) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.apc-role-chip {
  display: inline-block !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.07em !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  background: rgba(59, 130, 246, 0.15) !important;
  border: 1px solid rgba(59, 130, 246, 0.25) !important;
  color: #60a5fa !important;
  width: fit-content !important;
}

/* ── Completion block ── */
.apc-completion-block {
  margin-top: 18px !important;
}

.apc-completion-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px !important;
}

.apc-completion-label {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: rgba(226, 236, 255, 0.6) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.apc-completion-fraction {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: rgba(226, 236, 255, 0.45) !important;
}

/* ── Device card sub-text ── */
.apc-sub {
  font-size: 13px !important;
  color: rgba(226, 236, 255, 0.45) !important;
  line-height: 1.5 !important;
  margin-bottom: 14px !important;
  margin-top: 0 !important;
}

/* ── Device action buttons ── */
.apc-device-actions {
  display: flex !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  margin-bottom: 14px !important;
}

.apc-btn-ghost {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 8px 14px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: rgba(226,236,255,0.75) !important;
}

.apc-btn-ghost:hover {
  background: rgba(255,255,255,0.1) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.18) !important;
}

.apc-btn-danger {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 8px 14px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  background: rgba(239,68,68,0.08) !important;
  border: 1px solid rgba(239,68,68,0.2) !important;
  color: #f87171 !important;
}

.apc-btn-danger:hover {
  background: rgba(239,68,68,0.15) !important;
  border-color: rgba(239,68,68,0.35) !important;
  color: #fca5a5 !important;
}

/* ── Session list ── */
.apc-session-list {
  gap: 8px !important;
}

/* ── Editor title ── */
.apc-editor-title {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #fff !important;
  font-family: 'Space Grotesk', sans-serif !important;
  letter-spacing: -0.02em !important;
  margin: 0 0 20px 0 !important;
  padding-top: 4px !important;
}

/* ── Form layout ── */
.apc-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  flex: 1 !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255,255,255,0.08) transparent !important;
}

.apc-form::-webkit-scrollbar { width: 4px; }
.apc-form::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 999px; }

/* ── Form sections ── */
.apc-form-section {
  padding: 18px 0 !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}

.apc-form-section:last-of-type {
  border-bottom: none !important;
}

/* ── Section label (eyebrow inside form) ── */
.apc-section-label {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.09em !important;
  color: rgba(226, 236, 255, 0.4) !important;
  margin-bottom: 14px !important;
}

.apc-section-label svg {
  flex-shrink: 0 !important;
  opacity: 0.7 !important;
}

/* ── Field grids ── */
.apc-fields-grid {
  display: grid !important;
  gap: 12px !important;
}

.apc-fields-3col { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.apc-fields-2col { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

/* ── Individual field ── */
.apc-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.apc-field-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: rgba(226, 236, 255, 0.45) !important;
}

/* ── Input wrapper with icon ── */
.apc-input-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}

.apc-field-icon {
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: rgba(226, 236, 255, 0.25) !important;
  pointer-events: none !important;
  flex-shrink: 0 !important;
  z-index: 1 !important;
}

.apc-input-wrap input,
.apc-input-wrap select,
.apc-input-wrap textarea {
  width: 100% !important;
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.09) !important;
  border-radius: 10px !important;
  color: #e2ecff !important;
  font-size: 14px !important;
  transition: all 0.18s ease !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

/* With icon: add left padding */
.apc-input-wrap:has(.apc-field-icon) input,
.apc-input-wrap:has(.apc-field-icon) select {
  padding: 10px 12px 10px 36px !important;
}

/* Without icon: normal padding */
.apc-input-wrap:not(:has(.apc-field-icon)) input,
.apc-input-wrap:not(:has(.apc-field-icon)) select {
  padding: 10px 12px !important;
}

.apc-input-wrap input::placeholder {
  color: rgba(226,236,255,0.2) !important;
}

.apc-input-wrap input:focus,
.apc-input-wrap select:focus {
  background: rgba(59, 130, 246, 0.06) !important;
  border-color: rgba(59, 130, 246, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12) !important;
  outline: none !important;
  color: #fff !important;
}

.apc-input-wrap select option {
  background: #0d1929 !important;
  color: #e2ecff !important;
}

/* ── Form footer ── */
.apc-form-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 14px !important;
  padding-top: 20px !important;
  margin-top: auto !important;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  flex-wrap: wrap !important;
}

/* ── Status message ── */
.apc-status {
  flex: 1 !important;
  font-size: 13px !important;
  color: rgba(226,236,255,0.55) !important;
  min-width: 0 !important;
}

/* ── Save button ── */
.apc-save-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 12px 24px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #fff !important;
  border: 1px solid rgba(37, 99, 235, 0.6) !important;
  cursor: pointer !important;
  letter-spacing: 0.01em !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25) !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.apc-save-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.4) !important;
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
}

.apc-save-btn:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2) !important;
}

/* ── Avatar within apc-identity ── */
.apc-identity .profile-avatar-upload {
  width: 84px !important;
  height: 84px !important;
  flex-shrink: 0 !important;
}

.apc-identity .profile-avatar-trigger {
  width: 84px !important;
  height: 84px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  position: relative !important;
  display: block !important;
  cursor: pointer !important;
  border: 2.5px solid rgba(59, 130, 246, 0.5) !important;
  box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.08) !important;
  background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
  transition: all 0.2s ease !important;
}

.apc-identity .profile-avatar-trigger:hover {
  border-color: rgba(59, 130, 246, 0.9) !important;
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.16) !important;
}

.apc-identity .profile-avatar-placeholder {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 32px !important;
  font-weight: 800 !important;
  color: #fff !important;
  font-family: 'Space Grotesk', sans-serif !important;
  z-index: 0 !important;
}

.apc-identity .profile-avatar-image {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 2 !important;
}

.apc-identity .profile-avatar-overlay {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0,0,0,0.5) !important;
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
  z-index: 3 !important;
  color: #fff !important;
  border-radius: 50% !important;
}

.apc-identity .profile-avatar-trigger:hover .profile-avatar-overlay {
  opacity: 1 !important;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .apc-fields-3col {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  .account-profile-shell {
    grid-template-columns: 1fr !important;
  }

  .account-profile-left-col {
    flex-direction: row !important;
    flex-wrap: wrap !important;
  }

  .account-profile-left-col .account-profile-card {
    flex: 1 1 260px !important;
  }

  .apc-fields-3col,
  .apc-fields-2col {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {
  .account-profile-left-col {
    flex-direction: column !important;
  }

  .apc-identity-hero {
    flex-direction: column !important;
    text-align: center !important;
  }

  .apc-form-footer {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .apc-save-btn {
    justify-content: center !important;
  }
}
