:root {
    --primary:       #714B67;
    --primary-light: #9b6b8f;
    --primary-dark:  #513449;
    --bg-card:       rgba(255, 255, 255, 0.85);
    --font-main:     'Plus Jakarta Sans', sans-serif;
}

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

body {
    font-family: var(--font-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(113, 75, 103, 0.8) 0%, rgba(31, 28, 44, 0.9) 100%),
        url('https://images.unsplash.com/photo-1504052434569-70ad5836ab65?q=80&w=2070&auto=format&fit=crop')
        no-repeat center center / cover;
    background-blend-mode: multiply;
    color: #333;
    overflow-x: hidden;
    padding: 1.5rem;
}

/* ---- Formas decorativas de fondo ---- */
.shape {
    position: fixed;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
    /* Animación solo en dispositivos que lo acepten (no-prefers-reduced-motion) */
    will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
    .shape { animation: float 10s infinite ease-in-out alternate; }
    .shape-2 { animation-delay: -5s; }
}

.shape-1 {
    width: 400px; height: 400px;
    background: #714B67;
    top: -100px; left: -100px;
    border-radius: 50%;
}
.shape-2 {
    width: 500px; height: 500px;
    background: #d4a373;
    bottom: -150px; right: -150px;
    border-radius: 50%;
}

@keyframes float {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* ---- Enlace "volver a inicio" ---- */
.back-home {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255,255,255,0.75);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    z-index: 10;
    transition: color 0.2s;
}
.back-home:hover { color: white; }

/* ---- Contenedor principal ---- */
.auth-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-container.register { max-width: 650px; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Tarjeta glass ---- */
.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3rem 2.5rem;
    border-radius: 24px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

/* Shimmer al hover */
.auth-card::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg);
    transition: 0.7s;
    pointer-events: none;
}
.auth-card:hover::before { left: 150%; }

/* ---- Logo / cabecera ---- */
.auth-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo .icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 75px; height: 75px;
    background: linear-gradient(135deg, var(--primary), #a87b9b);
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(113, 75, 103, 0.3);
    margin-bottom: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
    .auth-logo .icon-wrapper { animation: pulse 2s infinite; }
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(113, 75, 103, 0.4); }
    70%  { box-shadow: 0 0 0 15px rgba(113, 75, 103, 0); }
    100% { box-shadow: 0 0 0 0 rgba(113, 75, 103, 0); }
}

.auth-logo i { font-size: 3rem; color: #ffffff; }

.auth-logo h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    letter-spacing: -0.5px;
}

/* ---- Formularios ---- */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    margin-left: 0.2rem;
}

.form-group.with-icon i.icon-prefix {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1.2rem;
    transition: color 0.3s;
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid transparent;
    background: rgba(241, 245, 249, 0.8);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    color: #334155;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.form-group.with-icon .form-control { padding-left: 3.2rem; }

.form-control:hover:not(:focus) {
    background: rgba(226, 232, 240, 0.9);
}

.form-control:focus {
    outline: none;
    background: #ffffff;
    border-color: rgba(113, 75, 103, 0.3);
    box-shadow: 0 4px 20px rgba(113, 75, 103, 0.1), inset 0 2px 4px rgba(0,0,0,0.01);
    transform: translateY(-2px);
}

/* Icono cambia de color al enfocar */
.form-control:focus ~ i.icon-prefix { color: var(--primary); }

/* ---- Botón principal ---- */
.btn-block {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--primary) 0%, #4a2f43 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 25px rgba(113, 75, 103, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.btn-block:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 15px 35px rgba(113, 75, 103, 0.35);
}
.btn-block:active { transform: translateY(1px); }

/* ---- Links auth ---- */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: #4a5568;
}

.auth-links a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    position: relative;
    padding: 0.2rem 0;
}
.auth-links a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0; left: 0;
    background-color: var(--primary);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}
.auth-links a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* ---- Alertas ---- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (prefers-reduced-motion: no-preference) {
    .alert { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; }
    .alert-success { animation: none; }
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.alert-danger  { background: #fff5f5; color: #c53030; border: 1px solid #feb2b2; }
.alert-success { background: #f0fff4; color: #2f855a; border: 1px solid #9ae6b4; }

/* ---- Grids de formulario (registro) ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1rem; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .auth-card { padding: 2rem 1.5rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .auth-logo h2 { font-size: 1.5rem; }
}
