/* Estilos modernos para el formulario de login */
:root {
    --primary-color: #f25c5c;
    --primary-hover: #e04b4b;
    --background-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-background: rgba(255, 255, 255, 0.25);
    --card-backdrop: blur(10px);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: rgba(255, 255, 255, 0.3);
    --border-focus: rgba(242, 92, 92, 0.6);
    --error-color: #ef4444;
    --success-color: #10b981;
    --google-color: #ea4335;
    --google-hover: #d73527;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    margin: 0;
    padding: 0;
}

.modern-login-container {
    background: var(--background-gradient);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px 20px 20px;
    padding-top: 8vh;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-card {
    background: var(--card-background);
    backdrop-filter: var(--card-backdrop);
    -webkit-backdrop-filter: var(--card-backdrop);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    padding: 32px;
    transition: all 0.3s ease;
}

.login-card:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 40px rgba(31, 38, 135, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
}

.brand-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    letter-spacing: -0.025em;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
    font-weight: 400;
}

.google-signin-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.google-signin-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: var(--border-focus);
    text-decoration: none;
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.google-icon {
    width: 18px;
    height: 18px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(242, 92, 92, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 65%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.3s ease;
    user-select: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    line-height: 1;
}

.password-toggle:hover {
    background: rgba(242, 92, 92, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.forgot-password {
    text-align: right;
    margin-bottom: 24px;
}

.forgot-password-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

.signin-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(242, 92, 92, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.signin-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(242, 92, 92, 0.4);
}

.signin-btn:active {
    transform: translateY(0);
}

.signup-link {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.signup-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.signup-link a:hover {
    text-decoration: underline;
}

.error-messages {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: var(--error-color);
    font-size: 14px;
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: var(--success-color);
    font-size: 14px;
}

.cart-notice {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: center;
}

.cart-notice-text {
    color: #0369a1;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

/* Formulario de recuperación de contraseña */
.lost-password-form {
    display: none;
}

.back-to-login {
    text-align: center;
    margin-top: 20px;
}

.back-to-login a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.back-to-login a:hover {
    text-decoration: underline;
}

/* Animaciones */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

/* Responsive */
@media (max-width: 640px) {
    .modern-login-container {
        padding: 16px;
        padding-top: 5vh;
    }
    
    .login-card {
        padding: 24px;
    }
    
    .login-title {
        font-size: 22px;
    }
    
    .password-toggle {
        font-size: 16px;
        right: 10px;
    }
}

/* Estados de carga */
.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
