:root {
    --bg-base: #040508;
    --purple-glow: #2b8fff;
    --purple-dim: rgba(43, 143, 255, 0.2);
    --glass-bg: rgba(12, 16, 25, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #8b9bb4;
    --error-color: #ff3366;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 20px 0; /* Para que en celulares pequeños no se corte arriba/abajo */
}

/* --- FONDOS Y LUCES --- */
.bg-grid {
    position: absolute; inset: 0;
    background-size: 50px 50px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    z-index: 1; pointer-events: none;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

.ambient-light {
    position: absolute; border-radius: 50%; filter: blur(120px); z-index: 0;
}
.light-purple { width: 600px; height: 600px; background: var(--purple-dim); top: 5%; left: 15%; animation: float 8s infinite alternate ease-in-out; }
.light-dark { width: 500px; height: 500px; background: rgba(0, 234, 255, 0.05); bottom: 5%; right: 15%; animation: float 6s infinite alternate-reverse ease-in-out; }

@keyframes float { 0% { transform: translateY(0) scale(1); } 100% { transform: translateY(-40px) scale(1.1); } }

/* --- CONTENEDOR REGISTRO --- */
.register-wrapper {
    position: relative; z-index: 10;
    width: 100%; max-width: 460px; /* Un poco más ancho que el login */
    padding: 20px;
}

.register-glass-box {
    background: var(--glass-bg);
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px 35px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.8), inset 0 0 20px rgba(43, 143, 255, 0.05);
    position: relative; overflow: hidden;
}

.register-glass-box::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--purple-glow), transparent);
}

/* --- CABECERA --- */
.brand-header { text-align: center; margin-bottom: 30px; }
.brand-icon { font-size: 40px; color: var(--purple-glow); margin-bottom: 15px; filter: drop-shadow(0 0 15px var(--purple-dim)); }
.brand-header h1 { font-size: 24px; font-weight: 800; letter-spacing: 2px; margin-bottom: 5px; }
.brand-header h1 span { color: var(--purple-glow); text-shadow: 0 0 10px var(--purple-dim); }
.brand-header p { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); letter-spacing: 1px; }

/* --- FORMULARIO E INPUTS --- */
.register-form { display: flex; flex-direction: column; gap: 20px; }

.input-group { position: relative; width: 100%; }

.input-icon {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 16px; transition: color 0.3s ease;
}

.input-group input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 16px 15px 16px 45px;
    color: #fff;
    font-family: 'Inter', sans-serif; font-size: 14px;
    outline: none; transition: all 0.3s ease;
}

.input-group input::placeholder { color: #5a6b85; }

.input-line {
    position: absolute; bottom: 0; left: 50%; width: 0%; height: 2px;
    background: var(--purple-glow); transition: all 0.4s ease; transform: translateX(-50%);
    border-radius: 0 0 12px 12px;
}

.input-group input:focus {
    background: rgba(0,0,0,0.5); border-color: rgba(43, 143, 255, 0.3);
    box-shadow: 0 0 15px rgba(43, 143, 255, 0.1);
}
.input-group input:focus ~ .input-line { width: 100%; }
.input-group input:focus ~ .input-icon { color: var(--purple-glow); }

.toggle-password {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); cursor: pointer; transition: color 0.3s ease;
}
.toggle-password:hover { color: #fff; }

/* --- BOTÓN SUBMIT --- */
.btn-submit {
    background: transparent;
    color: var(--purple-glow);
    border: 2px solid var(--purple-glow);
    border-radius: 12px;
    padding: 16px;
    margin-top: 10px;
    font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 700;
    letter-spacing: 2px; cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--purple-dim), inset 0 0 10px var(--purple-dim);
    display: flex; justify-content: center; align-items: center; gap: 10px;
}

.btn-submit:hover {
    background: var(--purple-glow); color: #000; box-shadow: 0 0 30px var(--purple-glow); transform: translateY(-2px);
}
.btn-submit:disabled { opacity: 0.7; cursor: not-allowed; pointer-events: none; }

/* --- ENLACE DE LOGIN --- */
.login-link { text-align: center; margin-top: 25px; font-size: 13px; color: var(--text-muted); }
.login-link a { color: var(--purple-glow); font-weight: 600; text-decoration: none; transition: all 0.3s ease; }
.login-link a:hover { color: #fff; text-shadow: 0 0 10px var(--purple-glow); }

/* --- SISTEMA DE TOASTS --- */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: rgba(15, 20, 30, 0.9); border-left: 4px solid var(--purple-glow);
    color: #fff; padding: 15px 20px; border-radius: 8px; font-size: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); backdrop-filter: blur(10px);
    transform: translateX(120%); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; align-items: center; gap: 12px; min-width: 250px;
}
.toast.show { transform: translateX(0); }
.toast.error { border-left-color: var(--error-color); }
.toast.error i { color: var(--error-color); }
.toast.success i { color: #00ff66; }

@media (max-width: 500px) {
    .register-glass-box { padding: 30px 20px; }
}
/* Celular: contener el resplandor decorativo para que la página no se deslice de lado */
html, body { overflow-x: hidden; max-width: 100%; }
.ambient-light { max-width: 100vw; }
