/* ==========================================================================
   Nitro Simracing - Profile Editors
   Visual language aligned to panel-piloto / panel-hub
   ========================================================================== */

.sn-profile-edit,
.sn-cuentas-pilotos-wrapper {
  position: relative;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(220, 38, 38, 0.12), transparent 28%),
    linear-gradient(155deg, rgba(7, 12, 22, 0.94), rgba(10, 16, 28, 0.97));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 24px 56px rgba(0, 0, 0, 0.42);
  color: #f4f8ff;
}

.sn-shell__title {
  margin: 0 0 8px;
  font-family: var(--sn-font-sans);
  font-size: clamp(1.8rem, 2vw, 2.35rem);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
}

.sn-shell__subtitle {
  margin: 0 0 18px;
  max-width: 760px;
  color: rgba(225, 233, 247, 0.72);
  font-size: 0.98rem;
  line-height: 1.55;
}

.sn-shell__section-title {
  margin: 20px 0 12px !important;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 248, 255, 0.86);
}

.sn-profile-edit .sn-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.sn-profile-edit .sn-select,
.sn-profile-edit .sn-input,
.sn-profile-edit input[type="text"],
.sn-profile-edit input[type="url"],
.sn-profile-edit select,
.sn-profile-edit textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #f7fbff;
  font-size: 0.95rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.sn-profile-edit textarea {
  min-height: 120px;
  padding-top: 12px;
  padding-bottom: 12px;
  resize: vertical;
}

.sn-profile-edit .sn-select:focus,
.sn-profile-edit .sn-input:focus,
.sn-profile-edit input:focus,
.sn-profile-edit select:focus,
.sn-profile-edit textarea:focus {
  outline: none;
  border-color: rgba(201, 13, 5, 0.7);
  box-shadow: 0 0 0 3px rgba(201, 13, 5, 0.16);
}

.sn-profile-edit .sn-select:disabled,
.sn-profile-edit .sn-input:disabled,
.sn-profile-edit input:disabled,
.sn-profile-edit select:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.sn-profile-edit .sn-btn {
  min-height: 46px;
}

.sn-profile-edit .sn-btn--danger {
  --_btn-bg: linear-gradient(135deg, #7b1111, #520909);
  --_btn-bg-hover: linear-gradient(135deg, #9d1717, #6a0c0c);
  --_btn-border: rgba(255, 130, 130, 0.28);
  color: #fff;
}

.sn-profile-edit .sn-btn--danger::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
}

.sn-empty-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(234, 240, 249, 0.75);
  text-align: center;
}

.sn-empty-state--compact {
  min-height: 92px;
}

.sn-empty-state--warn {
  border-color: rgba(255, 159, 10, 0.36);
  background: rgba(255, 159, 10, 0.08);
  color: #ffd49c;
}

.sn-table-wrap {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.sn-table {
  width: 100%;
  border-collapse: collapse;
  color: #edf3ff;
}

.sn-table td,
.sn-table th {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.sn-table tbody tr:last-child td {
  border-bottom: 0;
}

.sn-cuentas-grid,
.sn-redes-grid,
.sn-perifs-grid {
  display: grid;
  gap: 14px;
}

.sn-cuentas-grid {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.sn-cuenta-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(160deg, rgba(15, 23, 38, 0.98), rgba(10, 16, 28, 0.96));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.sn-cuenta-card__logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px;
}

.sn-cuenta-card__body {
  min-width: 0;
}

.sn-cuenta-card__body h4 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.sn-cuenta-card__slot {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(223, 234, 248, 0.82);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sn-cuenta-card__conn {
  justify-self: end;
}

.sn-cuenta-card__conn > * {
  margin: 0;
}

.sn-cuentas-discord-icon {
  color: #8ea6ff;
  font-size: 1.2rem;
}

.sn-perifs-grid {
  grid-template-columns: 1fr;
}

.sn-perif-group {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(160deg, rgba(11, 18, 30, 0.96), rgba(8, 14, 24, 0.95));
}

.sn-perif-group__head {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #eef4ff;
}

.sn-perif-group__head i {
  color: #c90d05;
}

.sn-perif-group__grid {
  display: grid;
  gap: 10px;
}

.sn-perif-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sn-perif-card__info {
  min-width: 0;
}

.sn-perif-card__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sn-perif-card__brand {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px;
  flex: 0 0 36px;
}

.sn-perif-card__name {
  display: block;
  color: #fff;
  font-weight: 700;
  line-height: 1.3;
}

.sn-perif-card__thumb-wrap {
  margin-top: 8px;
}

.sn-perif-card__thumb {
  width: 100%;
  max-width: 240px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.18);
}

.sn-perif-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sn-perifs-form,
.sn-redes-form {
  margin-top: 10px;
}

.sn-perifs-help {
  margin-top: 12px;
}

.sn-perifs-help .sn-btn {
  width: 100%;
  justify-content: center;
  white-space: normal;
  text-align: center;
  line-height: 1.4;
}

.sn-redes-grid {
  grid-template-columns: 1fr;
}

.sn-red-card {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(160deg, rgba(15, 23, 38, 0.98), rgba(10, 16, 28, 0.96));
}

.sn-red-card__brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px;
}

.sn-red-card__body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.sn-red-card__name {
  margin: 0;
  color: #fff;
  font-weight: 800;
}

.sn-red-card__input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.sn-red-card__input span {
  color: #9fb4d8;
  font-weight: 800;
}

.sn-red-card__input input {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.sn-red-card__input input:focus {
  box-shadow: none;
}

.sn-red-card__actions {
  display: grid;
  gap: 8px;
}

@media (max-width: 991px) {
  .sn-profile-edit,
  .sn-cuentas-pilotos-wrapper {
    padding: 18px;
    border-radius: 18px;
  }

  .sn-profile-edit .sn-row {
    grid-template-columns: 1fr;
  }

  .sn-cuenta-card,
  .sn-red-card {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .sn-cuenta-card__conn,
  .sn-red-card__actions {
    width: 100%;
    justify-self: stretch;
  }

  .sn-red-card__actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .sn-shell__title {
    font-size: 1.5rem;
  }

  .sn-cuenta-card,
  .sn-perif-card,
  .sn-red-card {
    padding: 12px;
  }

  .sn-perif-card {
    grid-template-columns: 1fr;
  }

  .sn-perif-card__actions,
  .sn-red-card__actions {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .sn-cuenta-card__logo,
  .sn-red-card__brand img {
    width: 56px;
    height: 56px;
  }
}
