/* ============================================
   ROYAL HISTORY — auth.css
   Login / Register / Auth pages
   Depende de theme.css (variables base)
   ============================================ */

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

body {
    font-family: var(--font-body, 'Raleway', sans-serif);
    background: #0a0a0a;
    color: #e8e0cc;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Fondo animado con partículas de luz */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 80%, rgba(201,168,76,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 20%, rgba(201,168,76,0.04) 0%, transparent 50%),
        #0a0a0a;
}

.auth-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(201,168,76,0.15) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.3;
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    from { opacity: 0.15; }
    to   { opacity: 0.35; }
}

/* Contenedor principal */
.auth-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    padding: 1.5rem;
}

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

.auth-logo a {
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.auth-logo img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(201,168,76,0.4));
}

.auth-logo .brand-name {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: 1rem;
    letter-spacing: 0.3em;
    color: var(--gold, #C9A84C);
    text-transform: uppercase;
}

/* Tarjeta glassmorphism */
.auth-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 1.5rem;
    padding: 2.5rem 2rem;
    box-shadow:
        0 0 0 1px rgba(201,168,76,0.05) inset,
        0 32px 64px rgba(0,0,0,0.5);
}

/* Título de la tarjeta */
.auth-title {
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold, #C9A84C);
    letter-spacing: 0.1em;
    text-align: center;
    margin-bottom: 0.4rem;
}

.auth-subtitle {
    font-size: 0.8rem;
    color: rgba(232,224,204,0.45);
    text-align: center;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

/* Grupos de campos */
.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(201,168,76,0.7);
    margin-bottom: 0.4rem;
    font-family: var(--font-display, 'Cinzel', serif);
}

.form-group input,
.form-group select {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 0.6rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: #e8e0cc;
    font-family: var(--font-body, 'Raleway', sans-serif);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    outline: none;
    -webkit-appearance: none;
}

.form-group input::placeholder {
    color: rgba(232,224,204,0.25);
}

.form-group input:focus,
.form-group select:focus {
    border-color: rgba(201,168,76,0.6);
    background: rgba(201,168,76,0.05);
    box-shadow: 0 0 0 3px rgba(201,168,76,0.08);
}

.form-group select option {
    background: #1a1610;
    color: #e8e0cc;
}

/* Input con ícono */
.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(201,168,76,0.4);
    font-size: 1rem;
    pointer-events: none;
}

.input-icon-wrap input {
    padding-left: 2.5rem;
}

/* Separador de sección */
.form-section-label {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(201,168,76,0.35);
    text-align: center;
    margin: 1.5rem 0 1rem;
    position: relative;
}

.form-section-label::before,
.form-section-label::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: rgba(201,168,76,0.15);
}

.form-section-label::before { left: 0; }
.form-section-label::after  { right: 0; }

/* Grid 2 columnas */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Errores de validación */
.field-error {
    font-size: 0.72rem;
    color: #e57373;
    margin-top: 0.3rem;
    letter-spacing: 0.03em;
}

/* Botón principal */
.btn-auth {
    width: 100%;
    background: linear-gradient(135deg, #C9A84C 0%, #a8862e 100%);
    border: none;
    border-radius: 0.6rem;
    padding: 0.9rem;
    font-family: var(--font-display, 'Cinzel', serif);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #0a0a0a;
    cursor: pointer;
    margin-top: 1.5rem;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(201,168,76,0.25);
}

.btn-auth:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(201,168,76,0.35);
}

.btn-auth:active {
    transform: translateY(0);
    opacity: 1;
}

/* Link inferior */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: rgba(232,224,204,0.4);
}

.auth-footer a {
    color: var(--gold, #C9A84C);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

.auth-footer a:hover { opacity: 0.75; }

/* Alerta de error general */
.auth-alert {
    background: rgba(229, 115, 115, 0.08);
    border: 1px solid rgba(229,115,115,0.25);
    border-radius: 0.6rem;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: #ef9a9a;
    margin-bottom: 1.2rem;
}

/* Alerta de info/status */
.auth-status {
    background: rgba(201,168,76,0.07);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 0.6rem;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: rgba(201,168,76,0.85);
    margin-bottom: 1.2rem;
    text-align: center;
}

/* Remember me */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold, #C9A84C);
    cursor: pointer;
    flex-shrink: 0;
}

.form-check label {
    font-size: 0.78rem;
    color: rgba(232,224,204,0.5);
    cursor: pointer;
    letter-spacing: 0.03em;
    text-transform: none;
    font-family: var(--font-body, 'Raleway', sans-serif);
    margin: 0;
}

/* Olvidaste contraseña */
.forgot-link {
    font-size: 0.75rem;
    color: rgba(201,168,76,0.5);
    text-decoration: none;
    float: right;
    margin-top: -0.1rem;
    transition: color 0.2s;
}

.forgot-link:hover { color: var(--gold, #C9A84C); }

/* Responsive */
@media (max-width: 520px) {
    .auth-card { padding: 2rem 1.25rem; border-radius: 1.2rem; }
    .form-row  { grid-template-columns: 1fr; }
    .auth-wrapper { padding: 1rem; }
}