

*, *::before, *::after { box-sizing: border-box; }


.panel-bg--auth {
  background:
    radial-gradient(ellipse 60% 55% at 78% 25%, rgba(183,63,255,0.18) 0%, transparent 68%),
    radial-gradient(ellipse 45% 55% at 15% 85%, rgba(61,244,255,0.14) 0%, transparent 62%),
    linear-gradient(180deg, #07050f 0%, #05040b 100%);
}


.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
}

.auth-glow-orb {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 640px; height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(183,63,255,0.14) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}


.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 2.5rem 2.25rem;
  border-radius: 24px;
  background: rgba(10, 8, 20, 0.72);
  border: 1px solid rgba(255,255,255,0.09);
  backdrop-filter: blur(22px);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.45),
    0 0 0 1px rgba(183,63,255,0.06) inset,
    0 0 60px rgba(61,244,255,0.05);
}


.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(61,244,255,0.5), rgba(183,63,255,0.35), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}


.auth-head {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin: 0 auto 0.9rem;
  filter: drop-shadow(0 0 18px rgba(183,63,255,0.5));
}

.auth-head .eyebrow { margin-bottom: 0.5rem; }

.auth-title {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  font-weight: 900;
  line-height: 1.15;
  color: #f5f6ff;
}

.auth-subtitle {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}


.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.auth-tab {
  position: relative;
  z-index: 1;
  padding: 0.65rem 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  transition: color 0.25s;
}

.auth-tab.active { color: #07070d; }

.auth-tab-indicator {
  position: absolute;
  z-index: 0;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 10px;
  background: var(--grad);
  box-shadow: 0 6px 20px rgba(61,244,255,0.25);
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
}

.auth-tabs[data-active="register"] .auth-tab-indicator {
  transform: translateX(100%);
}


.auth-form { display: none; flex-direction: column; gap: 1rem; }
.auth-form.active { display: flex; animation: auth-fade 0.4s ease; }

@keyframes auth-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-field { display: flex; flex-direction: column; gap: 0.4rem; }

.auth-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #c8caff;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 0.9rem;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.2s;
}

.auth-input-wrap input {
  width: 100%;
  padding: 0.8rem 0.9rem 0.8rem 2.7rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 0.92rem;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-input-wrap input::placeholder { color: #55587c; }

.auth-input-wrap input:focus {
  outline: none;
  border-color: rgba(61,244,255,0.55);
  background: rgba(61,244,255,0.04);
  box-shadow: 0 0 0 3px rgba(61,244,255,0.12);
}

.auth-input-wrap input:focus + .auth-toggle-pass,
.auth-input-wrap input:focus ~ .auth-input-icon { color: var(--cyan); }

.auth-field.has-error .auth-input-wrap input {
  border-color: rgba(255,80,120,0.6);
  box-shadow: 0 0 0 3px rgba(255,80,120,0.1);
}

.auth-toggle-pass {
  position: absolute;
  right: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.auth-toggle-pass svg { width: 18px; height: 18px; }
.auth-toggle-pass:hover { color: var(--cyan); background: rgba(61,244,255,0.08); }

.auth-error {
  font-size: 0.76rem;
  color: #ff6b8a;
  min-height: 0;
  line-height: 1.3;
}
.auth-field.has-error .auth-error { min-height: 1rem; }


.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: -0.25rem;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.auth-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.auth-check input:checked {
  background: var(--grad);
  border-color: transparent;
}

.auth-check input:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #07070d;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-check--terms { margin-top: 0.15rem; align-items: flex-start; }
.auth-check--terms input { margin-top: 1px; }

.auth-link-mini {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}
.auth-link-mini:hover { color: var(--pink); }

.auth-submit {
  justify-content: center;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem;
}

.auth-submit.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

.auth-switch {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}


.auth-strength {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: -0.1rem;
}

.auth-strength-bar {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.auth-strength-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.3s, background 0.3s;
}

.auth-strength-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 58px;
  text-align: right;
}

.auth-strength[data-level="1"] i { width: 33%;  background: #ff5f7a; }
.auth-strength[data-level="2"] i { width: 66%;  background: #ffb347; }
.auth-strength[data-level="3"] i { width: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); }


.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 1.25rem;
}
.auth-alert--error {
  background: rgba(255,80,120,0.1);
  border: 1px solid rgba(255,80,120,0.3);
  color: #ff8fa6;
}
.auth-alert--success {
  background: rgba(61,244,255,0.1);
  border: 1px solid rgba(61,244,255,0.3);
  color: var(--cyan);
}


.auth-card.is-pending .auth-tabs,
.auth-card.is-pending .auth-subtitle { display: none; }


.auth-layout.is-logged .auth-card,
.auth-layout.is-logged .auth-glow-orb { display: none; }


.auth-card { scroll-margin-top: 88px; }


.auth-pending {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  animation: auth-fade 0.4s ease;
}
.auth-pending.active { display: flex; }

.auth-mail-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  background: rgba(61,244,255,0.08);
  border: 1px solid rgba(61,244,255,0.25);
  box-shadow: 0 10px 30px rgba(61,244,255,0.18);
}
.auth-mail-icon svg { width: 34px; height: 34px; }

.auth-pending-email {
  font-family: "Orbitron", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cyan);
  word-break: break-all;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  background: rgba(61,244,255,0.06);
  border: 1px solid rgba(61,244,255,0.18);
}

.auth-pending-hint {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 340px;
}

.auth-welcome {
  font-family: "Orbitron", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #f5f6ff;
}

.auth-logged-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 320px;
}

.auth-logged-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}


.auth-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.72rem;
  color: #4a4d70;
  line-height: 1.5;
}


.profile-shell {
  display: none;
  width: 100%;
  grid-template-columns: 280px 1fr;
  align-items: start;
  gap: 2rem;
  animation: auth-fade 0.4s ease;
}
.profile-shell.active { display: grid; }


.profile-side {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.7rem;
  padding: 2.25rem 1.75rem;
  border-radius: 24px;
  background: rgba(10, 8, 20, 0.72);
  border: 1px solid rgba(255,255,255,0.09);
  backdrop-filter: blur(22px);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.45),
    0 0 0 1px rgba(183,63,255,0.06) inset;
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: "Orbitron", sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: #07070d;
  background: var(--grad);
  box-shadow: 0 10px 30px rgba(183,63,255,0.35);
  text-transform: uppercase;
}

.profile-avatar-img:not([hidden]) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar.has-image .profile-avatar-initial { display: none; }


.profile-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 20, 0.92);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--cyan);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, color 0.2s;
}
.profile-avatar-edit:hover {
  transform: scale(1.08);
  border-color: var(--cyan);
  color: var(--text);
}

.profile-username {
  font-family: "Orbitron", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f5f6ff;
  word-break: break-word;
}

.profile-role {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
}

.profile-side-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  margin-top: 0.75rem;
}
.profile-side-actions .btn { width: 100%; justify-content: center; }


.profile-main {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  min-width: 0;
}

.profile-title {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  font-weight: 900;
  line-height: 1.15;
  color: #f5f6ff;
  margin-top: 0.3rem;
}

.profile-desc {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 560px;
}

.profile-toast {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  background: rgba(61,244,255,0.1);
  border: 1px solid rgba(61,244,255,0.3);
  color: var(--cyan);
  animation: auth-fade 0.3s ease;
}

.profile-panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.profile-panel-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.75rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.profile-panel-card:hover {
  transform: translateY(-5px);
  border-color: rgba(61,244,255,0.3);
  box-shadow: 0 16px 50px rgba(61,244,255,0.10);
}

.profile-panel-tag {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(183,63,255,0.12);
  border: 1px solid rgba(183,63,255,0.25);
  color: var(--violet);
}

.profile-panel-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--grad-soft);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
}

.profile-panel-text h3 {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.profile-panel-text p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}

.profile-panel-arrow {
  margin-top: auto;
  align-self: flex-end;
  color: var(--cyan);
  font-weight: 700;
  font-size: 1.1rem;
  transition: transform 0.25s;
}
.profile-panel-card:hover .profile-panel-arrow { transform: translateX(4px); }


.avatar-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.avatar-modal.active { display: flex; }

.avatar-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 2, 8, 0.72);
  backdrop-filter: blur(6px);
  border: none;
  padding: 0;
  cursor: pointer;
}

.avatar-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2rem 1.9rem;
  border-radius: 24px;
  background: rgba(10, 8, 20, 0.92);
  border: 1px solid rgba(255,255,255,0.09);
  backdrop-filter: blur(22px);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.55),
    0 0 0 1px rgba(183,63,255,0.08) inset;
  animation: auth-fade 0.25s ease;
}

.avatar-modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.avatar-modal-close:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }

.avatar-modal-panel h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #f5f6ff;
  padding-right: 2rem;
}

.avatar-modal-hint {
  margin-top: 0.5rem;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.55;
}

.avatar-modal-alert {
  margin-top: 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
}
.avatar-modal-alert--error {
  background: rgba(255,80,120,0.1);
  border: 1px solid rgba(255,80,120,0.3);
  color: #ff8fa6;
}
.avatar-modal-alert--success {
  background: rgba(61,244,255,0.1);
  border: 1px solid rgba(61,244,255,0.3);
  color: var(--cyan);
}

.avatar-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  transition: opacity 0.2s;
}
.avatar-grid.is-busy { opacity: 0.55; pointer-events: none; }

.avatar-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.avatar-slot:hover { transform: translateY(-2px); border-color: rgba(61,244,255,0.3); }
.avatar-slot:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.avatar-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-slot.is-active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(61,244,255,0.35);
  cursor: default;
}

.avatar-slot-active-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(61,244,255,0.9);
  color: #07070d;
}

.avatar-slot-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(5,4,11,0.75);
  color: #fff;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.avatar-slot-delete:hover { background: rgba(255,80,120,0.85); }

.avatar-slot--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
  border-style: dashed;
}
.avatar-slot--empty:hover { color: var(--cyan); border-color: rgba(61,244,255,0.35); }


@media (max-width: 860px) {
  .profile-shell { grid-template-columns: 1fr; }
  .profile-side { position: static; }
  .profile-panels { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .auth-card { padding: 2rem 1.4rem; }
  .auth-title { font-size: 1.5rem; }
  .auth-logged-actions { flex-direction: column; width: 100%; }
  .auth-logged-actions .btn { width: 100%; justify-content: center; }
  .profile-panels { grid-template-columns: 1fr; }
  .profile-side-actions { flex-direction: column; }
  .avatar-grid { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
  .avatar-modal-panel { padding: 1.75rem 1.4rem; }
}
