
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

:root {
  --background: #070707;
  --surface: #101010;
  --border: #303030;
  --white: #ffffff;
  --muted: #888888;
  --accent: #ffffff;
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--background);
  color: white;
}

a {
  text-decoration: none;
  color: inherit;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

.account-security {
  width: min(460px, 90%);
  margin: 0 auto;
  padding: 80px 0;
}
.account-security .form-heading { margin-top: 40px; }
.account-security .form-message { margin-top: 20px; }
[hidden] { display: none !important; }

/* =========================
   ESTRUCTURA
========================= */

.auth-layout {
  display: grid;
  grid-template-columns: 45% 55%;
  min-height: 100vh;
}

/* =========================
   PANEL IZQUIERDO
========================= */

.visual-panel {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #111;
}

.visual-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.visual-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,.45) 0%,
    rgba(0,0,0,.12) 35%,
    rgba(0,0,0,.9) 100%
  );
}

.visual-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .12;
  background-image:
    linear-gradient(#fff 1px, transparent 1px),
    linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 65px 65px;
  mask-image: linear-gradient(transparent, black);
}

.visual-logo {
  position: absolute;
  top: 35px;
  left: 8%;
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 2;
}

.visual-logo img {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.visual-logo span {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
}

.visual-info {
  position: absolute;
  bottom: 110px;
  left: 9%;
  right: 9%;
  z-index: 2;
}

.system-tag,
.eyebrow {
  display: block;
  color: #aaa;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
}

.visual-info h2 {
  font-size: clamp(40px, 5vw, 75px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -3px;
  margin: 25px 0;
}

.visual-info p {
  font-size: 13px;
  color: #ddd;
  letter-spacing: .5px;
  line-height: 1.8;
}

.visual-line {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,.3);
  margin: 35px 0 20px;
}

.visual-code,
.visual-corner {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #bbb;
}

.visual-corner {
  position: absolute;
  bottom: 35px;
  left: 9%;
  z-index: 2;
}

/* =========================
   PANEL DERECHO
========================= */

.form-panel {
  position: relative;
  min-height: 100vh;
  padding: 110px 9% 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080808;
}

.back-link {
  position: absolute;
  top: 45px;
  left: 9%;
  display: inline-flex;
  align-items: center;
  gap: 15px;
  color: #999;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  transition: color .2s;
}

.back-link span {
  font-size: 20px;
}

.back-link:hover {
  color: white;
}

.auth-container {
  width: 100%;
  max-width: 460px;
}

.register-container {
  max-width: 630px;
}

.form-heading {
  margin-bottom: 43px;
}

.form-heading h1 {
  font-size: clamp(30px, 3.5vw, 48px);
  font-weight: 900;
  letter-spacing: -2px;
  margin: 18px 0;
}

.form-heading h1 span {
  color: #777;
}

.form-heading p {
  color: #999;
  font-size: 12px;
  line-height: 1.9;
  max-width: 420px;
}

/* =========================
   FORMULARIOS
========================= */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 23px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.form-group label,
.avatar-heading label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ddd;
}

.form-group input {
  width: 100%;
  height: 52px;
  padding: 0 17px;
  background: #121212;
  border: 1px solid #323232;
  color: white;
  font-size: 12px;
  outline: none;
  transition: border-color .3s, background .3s;
}

.form-group input::placeholder {
  color: #666;
}

.form-group input:focus {
  border-color: white;
  background: #181818;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.small-link {
  color: #999;
  font-size: 10px;
  transition: color .3s;
}

.small-link:hover {
  color: white;
}

/* CAMPO CONTRASEÑA */

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 90px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .6px;
}

.password-toggle:hover {
  color: white;
}

/* NICKNAME */

.input-prefix {
  position: relative;
}

.input-prefix > span {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-weight: 800;
  font-size: 15px;
}

.input-prefix input {
  padding-left: 38px;
}

.field-hint {
  color: #777;
  font-size: 10px;
  line-height: 1.5;
}

/* =========================
   BOTÓN PRINCIPAL
========================= */

.primary-btn {
  width: 100%;
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: white;
  border: 1px solid white;
  color: black;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  transition: .3s;
}

.primary-btn span:last-child {
  font-size: 22px;
  font-weight: 400;
}

.primary-btn:hover {
  background: transparent;
  color: white;
}

.form-message {
  color: #bbb;
  font-size: 11px;
  line-height: 1.6;
}

.form-message:empty {
  display: none;
}

/* =========================
   DIVISOR
========================= */

.divider-text {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 32px 0;
}

.divider-text span {
  height: 1px;
  background: #303030;
  flex: 1;
}

.divider-text p {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #777;
  white-space: nowrap;
}

/* =========================
   GOOGLE
========================= */

.google-btn {
  width: 100%;
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px;
  background: transparent;
  border: 1px solid #393939;
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: .3s;
}

.google-btn:hover {
  background: #181818;
  border-color: #777;
}

/* =========================
   CAMBIO LOGIN / REGISTRO
========================= */

.auth-bottom {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #292929;
}

.auth-bottom p {
  color: #777;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 15px;
}

.auth-bottom a {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  transition: color .3s;
}

.auth-bottom a:hover {
  color: #aaa;
}

.auth-bottom a span {
  font-size: 20px;
}

/* =========================
   FOTOS DE PERFIL
========================= */

.avatar-section {
  padding: 25px 0;
  border-top: 1px solid #303030;
  border-bottom: 1px solid #303030;
}

.avatar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.avatar-heading > span {
  color: #777;
  font-size: 9px;
  letter-spacing: 1px;
}

.avatar-description {
  color: #888;
  font-size: 11px;
  line-height: 1.7;
  margin: 15px 0 22px;
}

.avatar-preview-box {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #111;
  border: 1px solid #333;
  padding: 16px;
  margin-bottom: 20px;
}

.avatar-preview {
  width: 75px;
  height: 75px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #242424;
  border: 1px solid #444;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-preview > span {
  font-size: 35px;
  color: #777;
}

.avatar-preview-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.avatar-preview-info strong {
  font-size: 11px;
  letter-spacing: .8px;
  overflow-wrap: anywhere;
}

.avatar-preview-info > span {
  font-size: 10px;
  line-height: 1.5;
  color: #888;
  overflow-wrap: anywhere;
}

/* GALERÍA */

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.avatar-option {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  padding: 5px;
  background: #151515;
  border: 1px solid #333;
  transition: .2s;
}

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

.avatar-option:hover {
  border-color: #aaa;
  transform: translateY(-2px);
}

.avatar-option.selected {
  border: 2px solid white;
}

.avatar-option.selected::after {
  content: "✓";
  position: absolute;
  top: 0;
  right: 0;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  background: white;
  color: black;
  font-size: 12px;
  font-weight: 900;
}

/* SUBIR FOTO */

.upload-avatar {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-top: 18px;
  padding: 20px;
  border: 1px dashed #555;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.upload-avatar:hover {
  background: #171717;
  border-color: white;
}

.upload-icon {
  width: 43px;
  height: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #252525;
  font-size: 26px;
  font-weight: 400;
}

.upload-avatar > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.upload-avatar strong {
  font-size: 10px;
  letter-spacing: .6px;
}

.upload-avatar small {
  color: #777;
  font-size: 9px;
}

.upload-arrow {
  font-size: 20px;
  margin-left: auto;
}

/* TÉRMINOS */

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  cursor: pointer;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: white;
}

.checkbox-line span {
  color: #aaa;
  font-size: 10px;
  line-height: 1.7;
}

/* =========================
   FOOTER DEL FORMULARIO
========================= */

.form-footer {
  position: absolute;
  bottom: 30px;
  left: 9%;
  right: 9%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #555;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1200px) {
  .auth-layout {
    grid-template-columns: 40% 60%;
  }

  .form-panel {
    padding-left: 7%;
    padding-right: 7%;
  }

  .visual-logo span {
    font-size: 14px;
  }
}

@media (max-width: 850px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .visual-panel {
    min-height: 250px;
    height: 250px;
  }

  .visual-logo {
    top: 25px;
    left: 6%;
  }

  .visual-info {
    left: 6%;
    bottom: 25px;
  }

  .visual-info h2 {
    font-size: 35px;
    margin: 12px 0;
  }

  .visual-info p,
  .visual-line,
  .visual-code,
  .visual-corner {
    display: none;
  }

  .system-tag {
    font-size: 9px;
  }

  .form-panel {
    min-height: auto;
    padding: 100px 7% 100px;
  }

  .back-link {
    top: 30px;
    left: 7%;
  }

  .form-footer {
    left: 7%;
    right: 7%;
  }
}

@media (max-width: 500px) {
  .visual-panel {
    height: 210px;
    min-height: 210px;
  }

  .visual-logo img {
    width: 45px;
    height: 45px;
  }

  .visual-logo span {
    font-size: 13px;
  }

  .visual-info h2 {
    font-size: 29px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-heading h1 {
    font-size: 32px;
  }

  .form-panel {
    padding-left: 6%;
    padding-right: 6%;
  }

  .avatar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .avatar-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-footer {
    left: 6%;
    right: 6%;
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Google / Discord */
.google-slot{display:flex;justify-content:center;margin:0 0 4px}
.google-slot:empty{display:none}
.discord-gate{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;background:rgba(5,5,5,.94);padding:24px}
.discord-gate-box{max-width:460px;width:100%;border:1px solid #333;background:#0c0c0c;padding:36px 28px;text-align:center;color:#eee;font-family:inherit}
.discord-gate-tag{font-size:11px;letter-spacing:.2em;color:#888}
.discord-gate-box h2{margin:12px 0}
.discord-gate-box p{color:#aaa;line-height:1.5}
.discord-gate-btn{display:inline-block;margin-top:18px;padding:13px 26px;background:#5865f2;color:#fff;text-decoration:none;font-weight:700;letter-spacing:.1em}
.discord-gate-back{display:block;margin-top:18px;color:#888;font-size:13px}

/* Compacto */
.form-heading{margin-bottom:22px}
.form-heading h1{font-size:clamp(28px,3vw,38px)}
.auth-form{gap:14px}
.form-row{gap:12px}
.form-group{gap:6px}
.form-group input{height:44px}
.primary-btn{min-height:46px}
.avatar-section{margin-top:4px}
.avatar-preview-box{padding:10px;gap:12px;margin-bottom:12px}
.avatar-preview{width:56px;height:56px}
.avatar-grid{gap:8px;max-height:210px;overflow-y:auto}
.avatar-option{padding:3px}
.form-panel{padding-top:70px;padding-bottom:60px}
.back-link{top:24px}
@media(max-width:850px){.form-panel{padding-top:70px;padding-bottom:70px}}

.visual-panel {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px;
}
.visual-logo {
  position: static;
  align-self: flex-start;
  flex: none;
}
.visual-logo img {
  width: 48px;
  height: 48px;
}
.visual-image {
  position: static;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(660px, calc(100vh - 140px));
  object-fit: contain;
  margin: auto;
}
@media (max-width: 850px) {
  .visual-panel {
    position: relative;
    height: auto;
    min-height: 0;
    gap: 12px;
    padding: 16px 6% 20px;
  }
  .visual-logo {
    position: static;
  }
  .visual-image {
    max-height: 280px;
    margin: 0 auto;
  }
}
@media (max-width: 500px) {
  .visual-panel {
    height: auto;
    min-height: 0;
  }
  .visual-image {
    max-height: 220px;
  }
}
