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

/* ─── CONTENEDOR PRINCIPAL DE AUTENTICACIÓN (Integrado al Layout) ─── */
main.contenido-principal:has(.auth-container) {
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 50%, #1a1a1a 100%);
    padding: 0;
    margin: 0;
    min-height: calc(100vh - 80px);
}

/* Evitar el margen del footer para fondos ininterrumpidos */
main.contenido-principal:has(.auth-container)+.footer-principal {
    margin-top: 0;
}

.auth-container {
    font-family: 'Libre Bodoni', serif;
    min-height: calc(100vh - 80px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.auth-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

/* Contenedor de formularios auth: +15% ancho (440 * 1.15 ≈ 506px) */
.auth-card {
    width: 100%;
    max-width: 506px;
    background: rgba(17, 17, 17, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.1);
    padding: 40px 44px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 175, 55, 0.05) inset;
}

.auth-card .logo {
    text-align: center;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 14px;
}

.auth-card .logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.auth-card .logo h1 {
    font-size: 2.2em;
    font-weight: 600;
    color: #d4af37;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.auth-card .logo span {
    display: block;
    font-size: 0.5em;
    color: #888;
    letter-spacing: 0.25em;
    margin-top: 10px;
    text-transform: uppercase;
    font-weight: 400;
}

.auth-card .form-header {
    text-align: center;
    margin-bottom: 18px;
}

.form-header h2 {
    color: #fff;
    font-size: 1.4em;
    font-weight: 500;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.form-header p {
    color: #999;
    font-size: 0.9em;
    letter-spacing: 0.03em;
    font-weight: 400;
}

.form-grupo {
    margin-bottom: 16px;
}

.form-grupo label {
    display: block;
    font-size: 0.7em;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 10px;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.form-grupo input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 10, 10, 0.6);
    color: #fff;
    font-size: 1em;
    font-family: 'Libre Bodoni', serif;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

.form-grupo input:focus {
    outline: none;
    border-color: #d4af37;
    background: rgba(10, 10, 10, 0.8);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
    color: #666;
    transition: color 0.3s;
}

.toggle-password:hover svg {
    color: #d4af37;
}

.link-olvide {
    display: block;
    text-align: right;
    margin-top: 10px;
    font-size: 0.85em;
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
}

.link-olvide:hover {
    color: #d4af37;
}

.botones-auth {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.botones-auth .btn-submit {
    flex: 1;
    min-width: 140px;
}

.btn-crear-cuenta {
    flex: 1;
    min-width: 140px;
    padding: 14px 16px;
    background: transparent;
    border: 2px solid #d4af37;
    color: #d4af37;
    font-size: 0.95em;
    font-family: 'Libre Bodoni', serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-crear-cuenta:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #f4e09d;
    border-color: #f4e09d;
}

.btn-submit {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, #d4af37 0%, #b89530 100%);
    color: #000;
    border: none;
    font-size: 0.95em;
    font-family: 'Libre Bodoni', serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid #ef4444;
    color: #ff6b6b;
    padding: 14px 18px;
    margin-bottom: 28px;
    font-size: 0.88em;
    border-radius: 2px;
}

.separador {
    display: flex;
    align-items: center;
    margin: 40px 0 30px;
}

.separador::before,
.separador::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.separador span {
    color: #666;
    font-size: 0.7em;
    padding: 0 20px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.links {
    text-align: center;
    margin-bottom: 35px;
}

.links a {
    color: #d4af37;
    text-decoration: none;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.links a:hover {
    color: #f4e09d;
}

.auth-card .volver-tienda {
    display: block;
    margin-top: 24px;
    text-align: center;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.volver-tienda a {
    color: #777;
    text-decoration: none;
    font-size: 0.85em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* El logo y header están reutilizados globalmente desde la regla .auth-card .logo */

.form-fila {
    display: flex;
    gap: 12px;
}

.form-fila .form-grupo {
    flex: 1;
}

.auth-card .alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
    color: #ff6b6b;
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 0.88em;
    border-radius: 2px;
}

.auth-card .alert-error p {
    margin: 0 0 6px 0;
}

.auth-card .alert-error p:last-child {
    margin: 0;
}

.auth-admin-login-page {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-admin-login-page .login-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-admin-login-page .logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-admin-login-page .logo h1 {
    color: #d4af37;
    font-size: 2em;
    margin-bottom: 5px;
}

.auth-admin-login-page .logo p {
    color: #666;
    font-size: 0.9em;
}

.auth-admin-login-page .form-grupo {
    margin-bottom: 20px;
}

.auth-admin-login-page .form-grupo label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.auth-admin-login-page .form-grupo input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
    font-family: Arial, sans-serif;
    color: #000;
    background: #fff;
}

.auth-admin-login-page .form-grupo input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: none;
}

.auth-admin-login-page .error {
    background: #ffe6e6;
    color: #c41e3a;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #c41e3a;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: #d4af37;
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: #b89530;
}

.footer-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.footer-link a {
    color: #d4af37;
    text-decoration: none;
}

@media (max-width: 480px) {
    .form-fila {
        flex-direction: column;
        gap: 0;
    }

    .botones-auth {
        flex-direction: column;
    }

    .botones-auth .btn-submit,
    .btn-crear-cuenta {
        min-width: 100%;
    }
}

/* ─── RECUPERAR / RESTABLECER CONTRASEÑA ─── */
/* Heredan estilos generales de auth-container y auth-card configurados arriba */

.auth-title {
    font-size: 1.8em;
    font-weight: 600;
    color: #d4af37;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 16px;
}

.auth-helper {
    color: #999;
    font-size: 0.95em;
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.5;
}

.auth-form .form-group {
    margin-bottom: 24px;
}

.auth-form .form-group label {
    display: block;
    font-size: 0.7em;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 12px;
    font-weight: 500;
}

.auth-form .form-group input {
    width: 100%;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 10, 10, 0.6);
    color: #fff;
    font-size: 1em;
    font-family: 'Libre Bodoni', serif;
    transition: all 0.3s ease;
}

.auth-form .form-group input:focus {
    outline: none;
    border-color: #d4af37;
    background: rgba(10, 10, 10, 0.8);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

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

.auth-form .field-error {
    color: #ef4444;
    font-size: 0.85em;
    margin-top: 8px;
}

.auth-form .btn-primary.btn-full {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #d4af37 0%, #b89530 100%);
    color: #000;
    border: none;
    font-size: 0.95em;
    font-family: 'Libre Bodoni', serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.auth-form .btn-primary.btn-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.auth-card .alert.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border-left: 3px solid #22c55e;
    color: #86efac;
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 0.9em;
}

.auth-links {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.auth-links a {
    color: #d4af37;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.auth-links a:hover {
    color: #f4e09d;
}

.auth-links .auth-link-tienda {
    color: #777;
    font-size: 0.85em;
}

.auth-links .auth-link-tienda:hover {
    color: #d4af37;
}