/* ============================================
   MODAL DE LOGIN/REGISTRO - DISEÑO ELEGANTE
   ============================================ */

.login-modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(63, 17, 28, 0.2);
    overflow: hidden;
}

.login-modal-content .modal-header {
    background: linear-gradient(135deg, #3f111c 0%, #5a1a2e 100%);
    color: white;
    padding: 1.5rem;
}

.login-modal-content .modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.login-modal-content .modal-title i {
    color: #d4af37;
}

.login-modal-content .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.login-modal-content .btn-close:hover {
    opacity: 1;
}

.login-modal-content .modal-body {
    padding: 2rem;
    background: #fff;
}

/* Formularios */
.auth-form .form-label {
    font-weight: 500;
    color: #3f111c;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.auth-form .form-label i {
    color: #3f111c;
    opacity: 0.7;
}

.auth-form .form-control {
    border: 2px solid #e0d5e1;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form .form-control:focus {
    border-color: #3f111c;
    box-shadow: 0 0 0 0.2rem rgba(63, 17, 28, 0.1);
    outline: none;
}

.auth-form .form-control:invalid:not(:placeholder-shown) {
    border-color: #dc3545;
}

.auth-form .form-control:valid:not(:placeholder-shown) {
    border-color: #28a745;
}

/* Checkbox personalizado */
.auth-form .form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid #3f111c;
    cursor: pointer;
}

.auth-form .form-check-input:checked {
    background-color: #3f111c;
    border-color: #3f111c;
}

.auth-form .form-check-label {
    margin-left: 0.5rem;
    cursor: pointer;
    user-select: none;
}

/* Botón principal */
.btn-wine {
    background: linear-gradient(135deg, #3f111c 0%, #5a1a2e 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(63, 17, 28, 0.2);
}

.btn-wine:hover {
    background: linear-gradient(135deg, #5a1a2e 0%, #3f111c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(63, 17, 28, 0.3);
    color: white;
}

.btn-wine:active {
    transform: translateY(0);
}

/* Enlaces */
.text-wine {
    color: #3f111c !important;
}

.text-wine:hover {
    color: #5a1a2e !important;
    text-decoration: underline;
}

#forgotPassword {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s ease;
}

#forgotPassword:hover {
    color: #3f111c;
    text-decoration: underline;
}

/* Toggle entre formularios */
.toggle-form-text {
    color: #6c757d;
    font-size: 0.95rem;
}

#toggleForm {
    transition: all 0.3s ease;
}

#toggleForm:hover {
    transform: translateX(3px);
    display: inline-block;
}

/* Mensajes de alerta */
#authMessage {
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#authMessage.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

#authMessage.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

#authMessage.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Animación de transición entre formularios */
.auth-form {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner para botones */
.btn-wine.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-wine.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Validación visual */
.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Mejoras para mensajes de ayuda */
.form-text {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Separador estilizado */
.border-top {
    border-color: #e0d5e1 !important;
}

/* Responsive */
@media (max-width: 576px) {
    .login-modal-content .modal-body {
        padding: 1.5rem 1rem;
    }
    
    .login-modal-content .modal-title {
        font-size: 1.25rem;
    }
    
    .auth-form .form-control {
        font-size: 0.95rem;
        padding: 0.65rem 0.85rem;
    }
    
    .btn-wine {
        font-size: 0.95rem;
        padding: 0.65rem 1.25rem;
    }
}

/* Accesibilidad */
.auth-form .form-control:focus,
.auth-form .form-check-input:focus,
.btn-wine:focus {
    outline: 2px solid #3f111c;
    outline-offset: 2px;
}

/* Estilo para links dentro del formulario */
.auth-form a {
    color: #3f111c;
    text-decoration: none;
    transition: all 0.3s ease;
}

.auth-form a:hover {
    color: #5a1a2e;
    text-decoration: underline;
}

/* Icono de usuario en dropdown */
.navbar-nav .dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0d5e1;
}

.navbar-nav .dropdown-item {
    padding: 0.75rem 1.25rem;
    transition: all 0.2s ease;
}

.navbar-nav .dropdown-item:hover {
    background-color: #f8f5f9;
    color: #3f111c;
    padding-left: 1.5rem;
}

.navbar-nav .dropdown-item i {
    color: #3f111c;
    opacity: 0.7;
}
